Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

to query a date of birth but the date field is in text data type 1

Status
Not open for further replies.
Oct 9, 1999
1
PR
i'm trying to query a date of birth field wherein i want to have it in ascending order on a specified month. for example, i want to see names of people whose birthday starts from 01oct to 31 oct.the year doesn't matter. the problem is the field was not in date data type but in text.i cannot change it to date data type because all dates in this business are written like 991030 instead of 10/30/99. i tried the wildcards but didn't work. thanks for the help!
 
You can use Access's built-in string functions to isolate the substring you're interested in. Add a calculated column to your query such: "BirthMonth: Left(Birthdate, 2)" -- then you can sort or use selection criteria on that field.
 
Oops! When I looked again I saw that the month is the middle 2, rather than first 2 characters. So the string function would be: BirthMonth: Mid(Birthdate, 2,2).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top