Select to view content in your preferred language

Query on a Date Field with LIKE

636
2
Jump to solution
12-03-2012 08:55 AM
JoeBorgione
MVP Emeritus
I've exported a table from a SQL Server database into a personal geodatabase.  I need to query by a data field and can't quite figure out what I need to do when using a 'like' statement.

The date field in question looks like this:

10/6/2011 7:08:19 PM

There are thousands of records that have 10/6/2011 as the date.  So I tried:

[date_field] like #10/6/2011 *# etc, but I'm told the syntax is wrong.

I can use the equals statement like this:

[date_field] = #10/6/2011 7:08:19 PM#

and it's good to go.  But of course that's just one record...

Any suggestions are appreciated.
That should just about do it....
0 Kudos
1 Solution

Accepted Solutions
JakeSkinner
Esri Esteemed Contributor
Hi Joe,

You could use the following expression:

[DATE_FIELD] > #10-06-2011 00:00:00# AND [DATE_FIELD] < #10-06-2011 23:59:59#


This will select all the records with a date of 10/6/2011.

View solution in original post

0 Kudos
2 Replies
JakeSkinner
Esri Esteemed Contributor
Hi Joe,

You could use the following expression:

[DATE_FIELD] > #10-06-2011 00:00:00# AND [DATE_FIELD] < #10-06-2011 23:59:59#


This will select all the records with a date of 10/6/2011.
0 Kudos
JoeBorgione
MVP Emeritus
Thanks Jake; I did something similar and it worked out....
That should just about do it....
0 Kudos