Select By Attributes SQL expression CURRENT_DATE

424
1
04-07-2023 09:47 AM
Jim
by
New Contributor II

Hello ArcPro Brains,

I am trying to set up a model builder to Select By Attribute all the records that were started the day before. I am using the SQL window to add the code below

start_time <= (CURRENT_TIMESTAMP - 1)

Unfortunately, I am returning zero records and am not sure why. If I simply write:

start_time <= CURRENT_TIMESTAMP

I return all the records before the present. However, I every time I include the addition or subtraction I return the following "The SQL expression is valid, but no records were returned".

 

I've also tried CURRENT_DATE in the same formula with the same results. Thanks!

NobleJim_0-1680885846719.png

 

0 Kudos
1 Reply
RhettZufelt
MVP Frequent Contributor

Might try the DATEADD function.

start_time > DATEADD(day,-1,CURRENT_TIMESTAMP)

R_