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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

date conversion format text to date 1

Status
Not open for further replies.

din2005

Programmer
Mar 22, 2005
162
GB
Hi have this query which one of the fields is text format but have treatment dates e.g

trtDate

05Aug2005
25Apr2000
etc..

what i would like to do in my query is change this format to eg

05/08/2005
25/04/2000

is this possible? Could i have a sample criteria
 
it is possible, but there's no built in format for your trtDate field, so you'd have to build your own function to convert it to a recognisable format...

insert a module, make a function which parses your trtDate as input (a mix of left(), mid(), right() and dateserial() will easily convert that to a proper date), and then return the date value.

if you make the function public, and give it a unique name, then you can call it directly in your saved query...

--------------------
Procrastinate Now!
 
A starting point:
Expr1: CDate(Left(trtDate,2) & "/" & Mid(trtDate,3,Len(trtDate)-6) & "/" & Right(trtDate,4))

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top