PC Review


Reply
Thread Tools Rate Thread

Comparing two dates using between.

 
 
BerkshireGuy
Guest
Posts: n/a
 
      23rd Apr 2007
I have some data where each row has a date in the format of 20050101,
20060423, etc.

I wanted to create a pivot of this data, but have groups depending on
which date range they fall under.

>From other projects, I figured the best way to do this is have a new

column called date group and then having a comparision to indicate
which group it falls under.

I first need to reformat the date as 01/01/2005 and then do a between
comparision - i.e. Between 01/01/2005 and 03/01/2005 would get placed
the 01/01/2005 - 03/01/2005 group.

I'm assuming something with date serial?

Any ideas?

Thanks,
Brian

 
Reply With Quote
 
 
 
 
matt
Guest
Posts: n/a
 
      24th Apr 2007
On Apr 23, 7:17 am, BerkshireGuy <berkshireguy2005-
commeri...@yahoo.com> wrote:
> I have some data where each row has a date in the format of 20050101,
> 20060423, etc.
>
> I wanted to create a pivot of this data, but have groups depending on
> which date range they fall under.
>
> >From other projects, I figured the best way to do this is have a new

>
> column called date group and then having a comparision to indicate
> which group it falls under.
>
> I first need to reformat the date as 01/01/2005 and then do a between
> comparision - i.e. Between 01/01/2005 and 03/01/2005 would get placed
> the 01/01/2005 - 03/01/2005 group.
>
> I'm assuming something with date serial?
>
> Any ideas?
>
> Thanks,
> Brian


Assuming that a sample date is in cell A1, you could use the following
function:

=DATE(LEFT(A1,4),MID(A1,5,2),RIGHT(A1,2))

Matt

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Comparing two dates minimoi Microsoft Excel Programming 1 27th Jan 2010 03:57 PM
RE: Comparing Dates RonaldoOneNil Microsoft Access Queries 4 9th Nov 2008 11:21 PM
Comparing Dates jeff Microsoft Access Form Coding 10 2nd Apr 2007 07:05 AM
Comparing dates Simon Harvey Microsoft C# .NET 6 16th Feb 2006 09:36 AM
Comparing Dates Delenn Microsoft Access Reports 0 9th Feb 2004 04:27 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:16 AM.