General information
Category:
Coding, syntax & commands
Title:
Need SQL help for date/time record selection
I need to be able to select records from a table based on a date/time range. The date & time are separate fields in the table with the date defined as an 8 position date field & the time as an 8 position character field. I need the record selection to be a single SQL command because I am retrieving the records into Lotus Notes via ODBC. The following command does not work, but I believe the logic is correct for what I am wanting:
SELECT * FROM APDIST03;
WHERE GLFYEAR = FiscalYear AND DTSTAT = " " AND;
(ADDDATE = FromDate AND ADDTIME >= FromTime OR;
ADDDATE = ToDate AND ADDTIME <= ToTime OR;
ADDDATE >FromDate AND ADDDATE < ToDate)
TIA for any suggestions! :)
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only