Hello,

Does anyone know how to extract data from a record for a query? For example I have a sample number (Example: 1555A-S-070202-105500) and I would like to query todays date against it, the 070202 part of it. I would like to have Access show me all records with todays date in it. Does anyone know how to do this?

Thanks

j

Assuming that your format is always the same (yymmdd) and that it's placement in your string is always the same, try adding this to your as a field in your query, replacing [Example] with the field name that your text resides in:

DateConversion: Format(Mid([Example],11,2) & "/" & Mid([Example],13,2) & "/" & Mid([Example],9,2),"yymmdd")

This will extract and convert your text into date format. Use the fields criteria to check against a date.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.