borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2009 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (Split text and image from word document)Next Topic (error) New Topic New Poll Post Reply
AndreaVB Forum : ASP.Net : Date comparisons not taking the year into consideration
Poster Message
shrutimajithia
Level: Trainee

Registered: 29-08-2005
Posts: 1

icon 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
View Profile Send Email to User Show All Posts | Quote Reply
xtramac
Level: Professor


Registered: 28-08-2005
Posts: 94
icon 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
View Profile Send Email to User Show All Posts | Quote Reply
~Bean~
Level: VB Guru


Registered: 07-04-2003
Posts: 488
icon 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.

03-09-2005 at 01:41 AM
View Profile Send Email to User Show All Posts Visit Homepage | Quote Reply
AndreaVB Forum : ASP.Net : Date comparisons not taking the year into consideration
Previous Topic (Split text and image from word document)Next Topic (error) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2009 Andrea Tincaniborder