SQL Server 2000 CURRENT_DATE Query

296
1
09-21-2011 09:21 AM
TylerWaring
Occasional Contributor II
Greetings,
           I am setting up a Python script that selects a set of records according to their date. I want to get a set of records that have a date within 3 years. While testing in a geodatabase I was able to query successfully using the CURRENT_DATE constant. However in production my query fails against the SDE database. The query I have been using against the geodatabase is:

MAX_DATE_ > CURRENT_DATE-1096

How do I update this query to work against a SQL Server 2000 database.

Thanks,

Tyler Waring
0 Kudos
1 Reply
NanaDei
Esri Contributor
Hi Tyler,

Test the script with the GETDATE() function instead of CURRENT_DATE.

MAX_DATE_ > GETDATE()-1096

Thanks
0 Kudos