Need query to pull out string in field - Access97 (newbie to Access 97)

  • Thread starter Thread starter luddgang
  • Start date Start date
L

luddgang

Hello,

I am a green using MS Access 97.

In the query designer is there a way to "pull out" a
string that is in a field.

For example.

I have data in a field as follows:

Fx 12345 m/dd/ccyy 12:42:59 PM
Fx 12 m/dd/ccyy 3:42:59 AM
etc.

I want to basically return results from a query to give me
everything in the month of July 2003 (I.E. 7/1/2003 -
7/31/2003).

- The 'Fx' portion of the string is consistent
- The number (I.E. 12345 and 12) varies in size
- The date is always in m/dd/ccyy format
- The time is always in hh:mm:ss
- The AM/PM is always consistent

Is there a function that I can put in the query to find
dates between a range for example (between 7/01/2003 and
8/1/2003).

Sorry if this question is too basic.
 
In the query grid put the following

Field: TheDate: DateValue(Mid(TheDateField,Instr(4,TheDateField," ")))
Criteria: Between #7/01/2003# and #8/1/2003#

This should work as long as your field in never blank (null)

If it can be null, then you need to account for that by eliminating columns
where your field can be null

Field: TheDateField
Criteria: Is Not Null
 
Back
Top