3

I was wondering if anyone knew how to build a definition query in Arcmap 10.0 that returns only features that are f.e. only 7 days old. I have a SDE geodatabase with polygons, each with a "date"-field (format yyy-mm-dd). I would like to select these features based on their age:

Output 1 ; Last 7 days

Output 2 ; Last 14 days

Output 3 ; Last 30 days

Output 4 ; Last year

....

Thanks in advance

4
  • 1
    Can you please explain what you mean by: Feature 3 ; Last 30 days Jan 21, 2014 at 8:18
  • 1
    There is an ArcGIS Discussion Forum thread that may help. Also, can you use the edit button to revise your Question to include the RDBMS flavour and version that you are accessing via ArcSDE, please?
    – PolyGeo
    Jan 21, 2014 at 8:23
  • Sorry i meant different output options
    – Dallasbarr
    Jan 21, 2014 at 8:32
  • Is your "date" field recognized as a date type? What SQL queries have you tried?
    – Vince
    Jan 21, 2014 at 11:40

1 Answer 1

2

This works on an SDE/Oracle database - select the dates within the last year you can do something like this:

ACQUIREDATE > ADD_MONTHS(SYSDATE, -12)

or last 7 days

ACQUIREDATE > SYSDATE - 7
1
  • This worked great for me. (ArcGIS SDE 10.2, Oracle 11g)
    – J Graham
    Mar 24, 2014 at 12:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.