Skip to Content
0
Former Member
Apr 01, 2011 at 03:03 PM

SQL Command, filter data within date range.

490 Views

Hi Everyone,

For some reason, this command's where statement works fine in DBVisualizer, but when I use it in Crystal, with the date range criteria, the report doesn't return any data.

Any ideas?

Full SQL Statement

SELECT DISTINCT BI_CLOSE_DT, BI_SO_COM, BI_SO_NBR, BI_ACCT, BI_OPEN_DT, BI_SO_DET_KEY, BI_SO_STAT_CD, BI_SO_TO_ACCT, BI_SO_TO_CUST_NBR, BI_SO_TYPE_CD, BI_SRV_LOC_NBR
FROM BI_SO_DET
WHERE BI_SO_STAT_CD = 'X' and BI_SO_TYPE_CD IN ( 'NEW', 'NCBM', 'NEW-WF' ) and BI_SO_TO_ACCT IS NOT NULL and (BI_OPEN_DT  >= to_date('1-jan-2005') and  BI_OPEN_DT < to_date('31-dec-2005'))

Edited by: Johnbr on Apr 1, 2011 5:45 PM