Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am trying to make a select from an ODBC connection using this select:
SELECT TASK_ID, CANCELLED_DATE, CLOSED_TIME, CLOSED_DATE, DEADLINE_DATE, DEADLINE_TIME, DOCUMENT_TYPE, TASK_FAULT_CODE_ID, TASK_TYPE, X_OPEN
FROM REP_TASK_NF WHERE DEADLINE_DATE BETWEEN $(FromDate) AND $(ToDate);
$(FromDate) and $(ToDate) are both variables being used in a Calender Object.
Am i going the right way about this or is the not the best way of going about this?
Thanks
That might or might not work. If your variables are numeric dates and DEADLINE_DATE also is a numeric date field it should work. If not you need to make sure the dates have the same date format and you might need to use single quotes around the variable expansion: WHERE DEADLINE_DATE BETWEEN '$(FromDate)' AND '$(ToDate)'. It could even be that you need to use a function like to_date (for oracle) or convert (for sql server) to cast a string to a date.
I've tried putting the variables inside ' ' and that doesnt seem to let me select with both a FromDate and ToDate.
How to do I go about using the convert function?