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!

string to date

Status
Not open for further replies.

is1ma1il

MIS
Feb 15, 2002
51
US
Hi,

I am trying to do a microsoft query to pull data from a csv.
And in field date is as a string. but once the microsoft query has run i need the date field to be a date field, so i can sort it by date.

Can it be done in the query?

 
In vba, you can use:

Dim mVal As Long
For Each c In Range("DateRange")
mVal = DateValue(c.Text)
c.NumberFormat = "dd/mm/yy"
c.Value = Format(mVal, "dd/mm/yy")
Next

After the query has run - this should convert all your textdates to actual dates Rgds
~Geoff~
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top