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

STRING MANIPULATION FORMULA 2

Status
Not open for further replies.

Ann28

MIS
Apr 2, 2004
97
US
Hello everyone!

What is the quickest formula to convert the following data:

9/15/1971 (DEFINED AS TEXT)
12/3/1942

to this format:
1971-09-15
1942-12-03

Thank you for your help!

Ann [morning]
 
Format(CDate(yourTextVar), "yyyy-mm-dd")

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
How are ya Ann28 . . . . .

Try a custom format: [blue]yyyy-m-d[/blue]

Calvin.gif
See Ya! . . . . . .
 
THANK YOU ALL FOR YOUR HELP!!!!
Format(CDate(yourTextVar), "yyyy-mm-dd") is PERFECT!!!!

[peace]

 
Ann,
I am doing something similar. I wonder if you can help...

I have an UPDATE field for an inventory DB which autmatically poulates with NOW() whenever something in the record changes.
My UPDATE field is defined as TEXT. Problem is 1) when I view it, I see the day & time. ie., 7/25/2005 1:49:00 p.m. 2) when I search on date, obviously it doesn't find any records b/c the field isn't storing the day, but the day & time.

Question....how do I format NOW()? So I can use it?
 
1) use a field with data type DateTime instead of Text
2) use the Date() function instead of Now() if you don't care the time
3) avoid reserved word (as UPDATE) for field names

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Thanks for such a quick reply!

But I've just switched to using a Text field b/c the Date type was getting me nowhere. Thought I'd try this. As for the DATE(), that's a great idea. But how do I get it to read: [UPDATE] = DATE() ..... (where date is today? or is DATE() = today?)
 
No F1 key on your keyboard ?

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