yousafhassan

Definition Query to get the records added in the last six months

Discussion created by yousafhassan on May 25, 2012
Latest reply on May 23, 2013 by doopsterus
Hi
I am trying to write a definition query on a points file on an Oracle DB. I want to retrieve records added in the last six months. So far, I have written the following:

MONTHS_BETWEEN (SYSDATE, TO_DATE ( DATE_CREATED, 'DD/MM/YYYY')) <6

This doesn't return any rows at all.

I have also tried this code:

SYSDATE - DATE_CREATED < 185

This works to a certain extent but it is not precise.

Can anyone please help me find a solution to this?

Thanks.

Outcomes