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

Access string expression

Status
Not open for further replies.

ISTodd

Technical User
Mar 25, 2004
43
US
I am trying to establish a query with a calculated field to convert a number string to a format with seperators to represent a date-

ie.

I have field BirthDate =152000 representing the birth date 01/05/2000 any thoughts on how to convert the date with no leading "0" or "/"... To the needed format?

Thanks for any help you can offer..

Todd
 
And what 1122000: 11/02/2000 ? 01/12/2000?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
I think what PHV is trying to say is how to you distinguish between 11/2/2000 and 1/12/2000?

Basically the string storing of the date as you have it is going to make it extremely difficult to come up with the correct answer every time. My first thought was based on string length, but this does not work, as PHV has clearly shown.

I would think the BEST solution is to fix the data storage a the source...not try to bandaid something on top. Figure out a better way to store the date, perhaps even as a date field (ideal) or even include the zeros. Of course, this assumes you CAN correct the data. If not, you need to figure out the business logic necessary to make the determination of how to handle similar dates based on your string expression.

=======================================
People think it must be fun to be a super genius, but they don't realize how hard it is to put up with all the idiots in the world. (Calvin from Calvin And Hobbs)

Robert L. Johnson III
CCNA, CCDA, MCSA, CNA, Net+, A+, CHDP
VB/Access Programmer
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top