I need to write a query that will get all the rows in a specified date range and time range.
For example, I want to query all the rows from 5:00PM on 16-Sep-2010 to 9:00AM on 21-Sep-2010.
Any ideas as to how the query should be?
SELECT * FROM PERSONAL WHERE BIRTH_DATE_TIME BETWEEN '2000-01-01 00:00:00' AND '2002-09-18 12:00:00';
You just need to tell the processor what format the date/time is in: Select * from Table where date Between to_date('2009-05-24 06:15:00', 'yyyy-mm-dd hh24:mi:ss') and to_date('2009-05-24 08:15:00 ', 'yyyy-mm-dd hh24:mi:ss').
SELECT * FROM ATM WHERE TRANSACTION_TIME BETWEEN '2005-02-28 21:00:00' AND '2008-12-25 00:00:00';
SELECT * FROM TABLE
WHERE DATE BETWEEN '09/16/2010 05:00:00' and '09/21/2010 09:00:00'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With