Date Formatting

chris-uk-lad

Registered User.
Local time
Today, 12:57
Joined
Jul 8, 2008
Messages
271
Hi,

I have some code that retrieves data from a table via a query and then posts in a excel spreadsheet. However when the data is outputted it is output with a date field adopting the US format of (04/06/2009) instead of 06/04/2008) and i cant reformat it afterwards in the excel spreadsheet.

Any tips? thanks
 
I would reformat the date as a text string before putting it into the Excel spreadsheet. Use Format(datevalue,"dd/mm/yyyy"). if you need the value in date format check that the Excel cell is correctly formatted as Date before you insert the value.
 
thanks for the input, i just cant work the syntax of what you say into my current line.

Im using:

Code:
strSQL = strSQL & "#" & .Fields("AB19").Value & "#,"

but i cant fit in the format comment

tried:

Code:
strSQL = strSQL & "#" & Format(.Fields("AB19").Value, "dd/mm/yyyy")) & "#,"
 
Last edited:
Please check your Regional Settings in Control Panel and check that your cutsom settings are UK rather than US.
 

Users who are viewing this thread

Back
Top Bottom