Select to view content in your preferred language

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

693
1
05-25-2012 02:28 AM
YousafHassan
Emerging Contributor
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.
0 Kudos
1 Reply
JustinCornell
Occasional Contributor
Did you ever figure this out?  I have a join in my mxd and trying to query anything with a join using sysdate is giving me an error.
0 Kudos