Hi Team,

I want to fetch records with  date column between current date and a past
date.
Currently when i use between in phoenix it is not working.

Can any one help?

Query:

SELECT id,to_date(SUBSTR(ID2, (LENGTH(ID2)-7), 8),'yyyyMMdd','GMT') FROM
table1 h WHERE to_date(SUBSTR(ID2, (LENGTH(ID2)-7), 8),'yyyyMMdd','GMT')
between current_date() and (current_date()-2000)

RESULT:

 Empty result set fetched


Thanks,
Ns

PS: Valid data exists in the table to satisfy the query.

Reply via email to