[SOLVED]Having a brain fart - need some help with a DB query
Posted: Wed Oct 29, 2008 7:05 pm
Guys, I'm having a serious brain fart. It's a very simple question and I can't seem to get the simple answer to go along with it...
K, Given the following schema:
Table Name: date_orders
Fields: ( Start_date, Start_time, End_Date, End_Time)
I need to say "Given this time and date, give me all the upcoming records"
Take for instance a record set like this:
Id = 1
Start_Date = 10-29-2008
Start_Hour = 22:00:00
End_Date = 11-14-2008
End_Hour = 21:00:00
Id = 2
Start_Date = 10-29-2008
Start_Hour = 20:00:00
End_Date = 11-14-2008
End_Hour = 20:30:00
Id = 3
Start_Date = 10-29-2008
Start_Hour = 20:00:00
End_Date = 10-29-2008
End_Hour = 20:30:00
Id = 4
Start_Date = 10-29-2008
Start_Hour = 11:00:00
End_Date = 11-14-2008
End_Hour = 14:00:00
-----------------------------
Out of this data, I need it to say, ok, the upcoming records are 1,2,4
Since 1,2,4 have date ranges that go beyond today's date and will eventually fire off at the same time tomorrow..
Any help would be greatly appreciated.
K, Given the following schema:
Table Name: date_orders
Fields: ( Start_date, Start_time, End_Date, End_Time)
I need to say "Given this time and date, give me all the upcoming records"
Take for instance a record set like this:
Id = 1
Start_Date = 10-29-2008
Start_Hour = 22:00:00
End_Date = 11-14-2008
End_Hour = 21:00:00
Id = 2
Start_Date = 10-29-2008
Start_Hour = 20:00:00
End_Date = 11-14-2008
End_Hour = 20:30:00
Id = 3
Start_Date = 10-29-2008
Start_Hour = 20:00:00
End_Date = 10-29-2008
End_Hour = 20:30:00
Id = 4
Start_Date = 10-29-2008
Start_Hour = 11:00:00
End_Date = 11-14-2008
End_Hour = 14:00:00
-----------------------------
Out of this data, I need it to say, ok, the upcoming records are 1,2,4
Since 1,2,4 have date ranges that go beyond today's date and will eventually fire off at the same time tomorrow..
Any help would be greatly appreciated.