exportdelim changes date/time format

G

Guest

Hi

I have an access 2000 database that in code runs serveral csv export routines.

One of the routines has dates in it.

In the underpinning tables and queries the date has been formatted to
dd/mm/yy but every time i run the exports the dates always come out as
dd/mm/y 00:00:00

I can't see where this problem has arisen from and would appreciate any
advice anyone has

Thanks in advance

Gillian
 
R

Rick Brandt

gdonald20 said:
Hi

I have an access 2000 database that in code runs serveral csv export
routines.

One of the routines has dates in it.

In the underpinning tables and queries the date has been formatted to
dd/mm/yy but every time i run the exports the dates always come out as
dd/mm/y 00:00:00

I can't see where this problem has arisen from and would appreciate
any advice anyone has

Thanks in advance

Gillian

The format "property" only affects display inside Access and will not affect
what is exported. For that you have to export a query (not a table) and in the
query use the Format () "function" to produce the desired output.
 
G

Guest

Hi thanks for your reply, the export query qryOpen_Order_Lines has got both
of the date fields formatted as dd/mm/yy and still the export comes out
dd/mm/yy 00:00:00

When you run the query up the screen it works perfectly but the export
screws the dates up.

Any ideas about what i have done?

Thanks

Gillian
 
R

Rick Brandt

gdonald20 said:
Hi thanks for your reply, the export query qryOpen_Order_Lines has
got both of the date fields formatted as dd/mm/yy and still the
export comes out dd/mm/yy 00:00:00

When you run the query up the screen it works perfectly but the export
screws the dates up.

Any ideas about what i have done?

Yes, you used the format *property* instead of the Format() *function*. If
you read my original reply it was clearly stated the the property will have
no effect on what is exported.
 
G

Guest

Hi

Sorry i appear to have misunderstood

what i currently have written in the field in my query is

format([it_orddate],"dd/mm/yy")

I believed this to be the format function i take it i am incorrect.

If so could you tell me the correct syntax to use.

Thanks

Gillian
 
R

Rick Brandt

gdonald20 said:
Hi

Sorry i appear to have misunderstood

what i currently have written in the field in my query is

format([it_orddate],"dd/mm/yy")

I believed this to be the format function i take it i am incorrect.

If so could you tell me the correct syntax to use.

Well that is fine other than you need to give the field an alias name to use.
In the query grid it would look like...

AliasName: Format([it_orddate],"dd/mm/yy")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top