Home arrow static arrow Java Programming [Archive] - Database Bug
Warning: Creating default object from empty value in /www/htdocs/w008deb8/wiki/components/com_staticxt/staticxt.php on line 51
Java Programming [Archive] - Database Bug
This topic has 3 replies on 1 page.

Posts:93
Registered: 5/18/04
Database Bug  
Aug 3, 2004 8:40 PM



 
Hi,

I have this field in my database called "sending_time".
If in this field, I put "04/08/2004 1:10:00 PM" then the time now is "04/08/2004 1:05:00 PM" then how should my SQL statement looked like?
My current SQL statement is :
SELECT * FROM schedule WHERE sending_time BETWEEN sending_time > Now AND sending_time < DateAdd(""m"", 1, Now())
but I can not get the data... can somebody help me?
Thanks
 

Posts:12
Registered: 10/12/03
Re: Database Bug  
Aug 3, 2004 9:08 PM (reply 1 of 3)



 
I'm not sure what exactly you want to do. Do you want to retrieve all rows in the schedule table who's sending time is within a month of the current time?
 

Posts:93
Registered: 5/18/04
Re: Database Bug  
Aug 3, 2004 9:15 PM (reply 2 of 3)



 
Actually I want to retrieve all the rows in the schedule table which the sending time is between now and 5 mins later...
 

Posts:12
Registered: 10/12/03
Re: Database Bug  
Aug 3, 2004 9:22 PM (reply 3 of 3)



 
I'm not strong on my SQL syntax but how about

SELECT * FROM schedule WHERE sending_time > Now() AND sending_time < DateAdd(""mi"", 5, Now())
 
This topic has 3 replies on 1 page.