How to compare date?
Hi, all, I tried to compare two dates and get the difference of the days less than 30 but it didn't work . Here's my code:
select c.inst_seq_num, avg(c.dlt_egt) as a from EHM_CMPRDLT c where c.inst_seq_num='#inst_seq_num[CurrentRow]#' and datediff(dd, c.end_dt,'#end_dt[CurrentRow]#')<30 group by c.inst_seq_num
I set up oracle database as ODBC, and write the code in coldfusion.
following is the error message:
ODBC Error Code = S0022 (Column not found)
[Microsoft][ODBC driver for Oracle][Oracle]ORA-00904: invalid column name
SQL = "select c.inst_seq_num, avg(c.dlt_egt) as a from EHM_CMPRDLT c where c.inst_seq_num='22' and datediff(dd, c.end_dt,'1996-04-06 16:29:00')<30 group by c.inst_seq_num"
Data Source = "ORACLE_EPRNET"
The error occurred while processing an element with a general identifier of (CFQUERY), occupying document position (40:1) to (40:73).
Any suggestions? Thanks a lot!