Query for a date, any date

G

Guest

Hello:

This seems too simple, but I just can't see how to do it. I need to query
for a date, any date. As long as MM/YY or MM/DD/YY or MM/DD/YYYY appears with
any date in a feild I need it to come up in a query. The dates are mixed into
a name feild. For example I'm currently also querying for names that have
"144A" in them. So if a Name in the table is "Westinghouse 144A" is will
appear in the query. I expect values such as "Westinghouse 04/09/2009" to
come up. I want these to come up in the query. The exact date does not
matter. If it has any date it needs to report.

Thank you,
Robert
 
G

Guest

As long as MM/YY or MM/DD/YY or MM/DD/YYYY appears with any date
It ain't so simple because Access will see these combinations as text and
not as dates. IF your dates ALWAYS use two digit monthe and two digit day
as shown above you are in a little luck - maybe.
Use these as criteria --
Like "* ??/??/???? *" OR Like "* ??/??/?? *" OR Like "* ??/?? *"
 
J

John W. Vinson

Hello:

This seems too simple, but I just can't see how to do it. I need to query
for a date, any date. As long as MM/YY or MM/DD/YY or MM/DD/YYYY appears with
any date in a feild I need it to come up in a query. The dates are mixed into
a name feild. For example I'm currently also querying for names that have
"144A" in them. So if a Name in the table is "Westinghouse 144A" is will
appear in the query. I expect values such as "Westinghouse 04/09/2009" to
come up. I want these to come up in the query. The exact date does not
matter. If it has any date it needs to report.

Thank you,
Robert

The 144A is of course easy: LIKE "*144A*"

As Karl says, getting fields containing a date is a tough one. Might these be
"hits"?

"Westinghouse 10-13-2001"
"Westinghouse May 15, 2006"
"Westinghouse 5/3"


What's the context? Why do you have this non-atomic data? Is there any way to
get the information more cleanly?

I was trying to think of a way to substring the data and use the IsDate()
function to check, but I can't think of any efficient way to do it.

John W. Vinson [MVP]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top