Query with date field
Posted: Tue Jul 17, 2007 6:43 pm
Hi,
In the Informix client database stage, I am writing query as given below:
SELECT
col1, col2, col3, col4, batch_dt
FROM tab_nam WHERE batch_dt<Today-13 units month
and batch_dt >= #start_date#
But it is not selecting correct set of records. Job runs well and data is also selected, but " batch_dt >= #start_date# " condition is not getting checked.
If I try to give as
" batch_dt >= '#start_date#' " ,
it gives me error.
Please let me know the appropraite way to compare date fields with actual value.
Thanks,
Abhilasha
In the Informix client database stage, I am writing query as given below:
SELECT
col1, col2, col3, col4, batch_dt
FROM tab_nam WHERE batch_dt<Today-13 units month
and batch_dt >= #start_date#
But it is not selecting correct set of records. Job runs well and data is also selected, but " batch_dt >= #start_date# " condition is not getting checked.
If I try to give as
" batch_dt >= '#start_date#' " ,
it gives me error.
Please let me know the appropraite way to compare date fields with actual value.
Thanks,
Abhilasha