query nearest time

Reply

Join Date: Sep 2006
Posts: 54
Reputation: royaloba is an unknown quantity at this point 
Solved Threads: 1
royaloba royaloba is offline Offline
Junior Poster in Training

query nearest time

 
0
  #1
Nov 17th, 2007
hello guys,
how can i select from table with a given time then select the nearest time available
sample select * from mytable where Time=10:00, i want to get the nearest time
ID | Time
1 09:00
2 13:00
3 15:00
Reply With Quote Quick reply to this message  
Join Date: Feb 2007
Posts: 2,094
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: query nearest time

 
0
  #2
Nov 17th, 2007
What do you mean by nearest .
What is the parameter of nearest
1 min
30 min
1 hr
2 hr
.....
....
What you want ?
Share your Knowledge.
Reply With Quote Quick reply to this message  
Join Date: Sep 2006
Posts: 54
Reputation: royaloba is an unknown quantity at this point 
Solved Threads: 1
royaloba royaloba is offline Offline
Junior Poster in Training

royaloba

 
0
  #3
Nov 18th, 2007
Originally Posted by debasisdas View Post
What do you mean by nearest .
What is the parameter of nearest
1 min
30 min
1 hr
2 hr
.....
....
What you want ?
sample i have a table consisting the following data
ID TIME
1 08:00
2 09:00
3 11:00
4 14:00
5 15:00

when i query from this table, i want to find the nearest or closest time to my given time
sample select * from mytable where mytime 08:30 then get the closest time available
Reply With Quote Quick reply to this message  
Join Date: Feb 2007
Posts: 2,094
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: query nearest time

 
0
  #4
Nov 19th, 2007
Thats what i asked . How much closer to the input time.
Share your Knowledge.
Reply With Quote Quick reply to this message  
Reply

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



Similar Threads
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