Good morning,
i know this was probably asked before, but im kinda in a jam. i have a database where it has a date field and a time field. i want to use a radio button to filter the fields. Say i have 3 radio buttons, the first one only filters last 24hrs, second one does 3 days and the 3rd one does a week. what is the SQL statement for this. im soo stuck. i dont need some long coding, just the SQL coding would be nice. thanks for any help.

Nevermind... remember the "BETWEEN" statement.. simple but mind twisting.

SELECT * FROM table WHERE field BETWEEN 'date or time' AND 'date or time'

Edited by fobos: n/a

8 Years
Discussion Span
Last Post by Ancyent
Select * FROM tables WHERE time_table > "value_date" and time_table < "value_date"

Hope that helps.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.