Click to See Complete Forum and Search --> : Time query


andre187
02-02-2009, 10:31 PM
I need to write a query for a specific time where my time is in 00:00:00 XX format, i need the instances for times between 8 am and 12 pm .

heres where I got after toying for a bit

SELECT Flights.FLIGHT_NO, Flights.ORIG, Flights.ORIG_TIME, Flights.DEST, Flights.DEST_TIME
FROM Flights
WHERE Flights.ORIG="LAX" AND ((8<Flights.ORIG_TIME AND Flights.ORIG_TIME='AM') AND (Flights.ORIG_TIME<12 AND Flights.ORIG_TIME='PM');

yes horrible, I know, well I tried

Phill Pafford
02-03-2009, 08:13 AM
MySQL

SELECT Flights.FLIGHT_NO, Flights.ORIG, Flights.ORIG_TIME, Flights.DEST, Flights.DEST_TIME
FROM Flights
WHERE Flights.ORIG="LAX"
AND Flights.ORIG_TIME BETWEEN '08:00:00' AND '23:59:59'

andre187
02-03-2009, 09:52 AM
thank you