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

Manipulating Date Format..

Status
Not open for further replies.

ChiTownDiva

Technical User
Jan 24, 2001
273
US
Happy Thursday All...[morning]

What I want to do is update a field with this:

If the month of a [date] field (formatted as i.e. 1/1/2005) is between January and September, then update [transaction date] field as 01012005 (or whatever the month and year are in the [date] field) else update the field with the format as 10012005.

In other words, if the month of the [date] field is between January and September, remove the slashes and add 2 leading zeros. If the months are from October through December, add 1 leading zero for the day.

I've tried Val(), Mid, Left, Right, InStr, Str...

I give up.

Help! [sadeyes]

Thanks in advance.

ChiTownDiva [ponytails]
 
If the field is defined as DateTime then simply use Format([transaction date], "mmddyyyy")

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
You are on a wild goose chase here.

The way a date field is displayed is controlled by the Format property of the textbox on a form or by the Format property of the field in a table.

You could use "mmddyyyy".

You should appreciate that wherever you use a date field you must format it the way you want it to appear.

 
As soon as I posted my question, I figured it out. (Duhhhh). I think I just needed to step away from it overnight.

Thanks PHV and Lupins46.

ChiTownDiva [ponytails]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top