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

Reformat Date in an Update Query

Status
Not open for further replies.

tinkertoy

Programmer
May 10, 2002
25
US
My database was created from an Excel spreadsheet which was created from a text file. The date came across as such:
"YYYYMMDD". The date field is "Request Date". In order for it to appear correctly I believe I need to create an update query, but I am unsure of what the criteria would be. I found a question/answer for update query, for a number, I tried it for my query, but it wouldn't work, "0" records to update. I want the field to be a date field, i.e. "MM/DD/YYYY". Any assistance is appreciated!!

Thanks!

tinkertoy [ponytails][thumbsup2]
 
Is "YYYYMMDD" in a text field and you want to put it in a datetime field? Any valid date format in the text field can be moved to the date field.

These are valid.
Dim Date1 as Date, var1 as string, var2 as string
var1 = "2002-02-20"
var2 = "02/20/2002"
date1 = var1
OR
date1 = var2

So, if you convert YYYYMMDD to YYYY-MM-DD or MM/DD/YYYY then you can move to date field and will have the date you expect. Use one of the String Functions like Mid() to modify your date format in the text field.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top