Date comparisons not taking the year into consideration
Hi,
I am having problems while sorting my report on the date column.
It sorts on the day and month but does not sort on the Year
for ex.
if I sort on the date i get the following results: (mm/dd/yyyy)
01/03/2004
01/04/2004
01/05/2003
01/06/2003
01/07/2004
Please help !!
Regards,
Shruti Majithia
29-08-2005 at 08:39 AM
|
xtramac Level: Professor Registered: 28-08-2005 Posts: 89
Re: Date comparisons not taking the year into consideration
hello.. you would be the first person to ever receive any posts from me. :-)
my suggestion to is.... convert your date into its numeric form since all date has a time serial.. maybe you can use the cdec() function. ex.
dim x as date
x = cdec(11/12/2005)
x will store a decimal value.. and based on this value you can now easily sort d dates.. another thing also.. there are a lot of functions you use 4 this prob..
ciao.. hope this helps
30-08-2005 at 04:58 AM
|
~Bean~ Level: VB Guru Registered: 07-04-2003 Posts: 488
Re: Date comparisons not taking the year into consideration
are you pulling the dates from a database?
if so let the DB do the work using ORDER BY...
it might help us if you post the code that you are currently using...
____________________________
Eggheads unite! You have nothing to lose but your yolks.