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

Excel Date conversions going US not European/Australian

Status
Not open for further replies.

AndrewForrest

Programmer
Jan 27, 2004
43
AU
Hi All,

I am reading a SQL database and putting dates into an excel cell. The date field is stored as a numeric yyyymmdd -20040124 - I am converting the date to dd/mm/yyyy 24/01/2004 (European/Australian format), before loading into the date(dd-mmm-yyyy - 24-Jan-2004) formated cell, this works fine for any date with the day portion >12 otherwise 04/01/2004 (4th Jan) displays as 01-Apr-2004.

EXCEL CODE :-
strF = "f" & Trim(Str(intN))
Range(strF).Select
ActiveCell.FormulaR1C1 =
DateDMY(rs"OEORDLIN_SQL.request_dt"))

DateDMY() is a functon that converts the date as described above

Windows Regional Settings
Your Local= English(Australian)
Date = d/MM/yyyy



 
Please see this thread:
thread68-770598

Basically, you need to use the DATEVALUE function to returnt he SERIAL number of a date and then format it AFTER you have entered the date (number) into excel

Rgds, Geoff
[blue]Experience is something you don't get until just after you need it[/blue]
We want to help [red]you[/red] Help us by reading this FAQ 1st faq222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top