Sorting a .mdb database by date?

Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Oct 2008
Posts: 20
Reputation: Entropy1024 is an unknown quantity at this point 
Solved Threads: 0
Entropy1024 Entropy1024 is offline Offline
Newbie Poster

Re: Sorting a .mdb database by date?

 
0
  #11
Oct 22nd, 2008
Ah. OK thank you. I will do that.

Cheers
Reply With Quote Quick reply to this message  
Join Date: Oct 2008
Posts: 20
Reputation: Entropy1024 is an unknown quantity at this point 
Solved Threads: 0
Entropy1024 Entropy1024 is offline Offline
Newbie Poster

Re: Sorting a .mdb database by date?

 
0
  #12
Oct 22nd, 2008
Great, thank you, That fixed it. Sort of anyway

It initially appears to have done nothing, but if I then close my program and restart it then the records are in date order. Is there some way to force a sort at runtime?

Many thanks for the help.
Reply With Quote Quick reply to this message  
Join Date: Feb 2007
Posts: 2,099
Reputation: debasisdas will become famous soon enough debasisdas will become famous soon enough 
Solved Threads: 128
debasisdas's Avatar
debasisdas debasisdas is offline Offline
Postaholic

Re: Sorting a .mdb database by date?

 
0
  #13
Oct 22nd, 2008
you need to convert the data in text format to date format and then sort.
Share your Knowledge.
Reply With Quote Quick reply to this message  
Join Date: Jul 2007
Posts: 300
Reputation: jireh is an unknown quantity at this point 
Solved Threads: 42
jireh's Avatar
jireh jireh is offline Offline
Posting Whiz

Re: Sorting a .mdb database by date?

 
0
  #14
Oct 23rd, 2008
In your code put this query before you bind it in the grid...

Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. "select * from [tablename] order by datefield asc"
Reply With Quote Quick reply to this message  
Join Date: Oct 2008
Posts: 20
Reputation: Entropy1024 is an unknown quantity at this point 
Solved Threads: 0
Entropy1024 Entropy1024 is offline Offline
Newbie Poster

Re: Sorting a .mdb database by date?

 
0
  #15
Oct 26th, 2008
OK great thanks got it to work. The following code worked.

Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. AdHocData.RecordSource = "select * from AdHocData order by StartDateTime asc"
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the Visual Basic 4 / 5 / 6 Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC