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

Convert from Long Date

Status
Not open for further replies.

air1access

Technical User
Jan 27, 2008
123
0
0
US
I have a text field value that I need to convert from December 11, 2014 3:58 PM to 12/11/2014 3:58 PM

Any suggestions or examples.. I'm stumped..!!
Thanks in advance..!!!
jcw5107
 
How about:

Code:
Dim strDate As String

strDate = "December 11, 2014 3:58 PM"

Debug.Print [blue]Format(CDate(strDate), "MM/DD/YYYY hh:mm AMPM")[/blue]

Have fun.

---- Andy

A bus station is where a bus stops. A train station is where a train stops. On my desk, I have a work station.
 
I tried that... I can't get it to work...
Just get #Error as the result...
 
I get exactly the expected results from Andy's suggestion.
How did you attempt to implement his expression?
Do you have any Nulls in your data?
Are all of your text values consistent in format?

Duane
Hook'D on Access
MS Access MVP
 
Sorry about that..
I didn't realize there were extra characters in the value... Duhhh...!!
What Any suggested works perfectly. My bad..!!

Jw
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top