Date field

  • Thread starter Thread starter Peter
  • Start date Start date
P

Peter

Hi,

I have problem with date field in table. I need to export query in txt file.
Date field in table needs to be in format dd.mm.yyyy
The problem is that when I export query to txt file, date field comes in
this format but also INCLUDES TIME. I have set 'short date' in table design,
and it should be working fine, but it isn't. Why I get also time? In table
is shown only date.
Anyone knows solution?

Thanks for answer
 
I have problem with date field in table. I need to export query in txt
file.
Date field in table needs to be in format dd.mm.yyyy
The problem is that when I export query to txt file, date field comes in
this format but also INCLUDES TIME. I have set 'short date' in table design,
and it should be working fine, but it isn't. Why I get also time? In table
is shown only date.
Anyone knows solution?

format the date to the needed format by using
format(yourDateFieldHere, "dd.mm.yyyy", vbUseSystemDayOfWeek,vbFirstJan1)

Joe.
 
Hi,

I have problem with date field in table. I need to export query in txt file.
Date field in table needs to be in format dd.mm.yyyy
The problem is that when I export query to txt file, date field comes in
this format but also INCLUDES TIME. I have set 'short date' in table design,
and it should be working fine, but it isn't. Why I get also time? In table
is shown only date.
Anyone knows solution?

Thanks for answer

Exporting data ignores format settings. Instead use the Format()
*function* to explicitly cast the date/time field into a String: put

ExpDate: Format([datefield], "dd.mm.yyyy")

in a vacant field cell in a query, and export that instead of the
field itself.
 
ExpDate: Format([datefield], "dd.mm.yyyy")
in a vacant field cell in a query, and export that instead > of the field
itself.

I have put it in field cell in a query.
I got an error: "You omited operand or operator, you entered invalid
character or comma, or you entered text without surrounding it in quotation
marks."
Error highlights comma after datefield.

Do you know why?

Thanks for help
 
mmm dd will give you Mar 16, mmmm dd will give you March 16, mm/dd will give
you 03/15...
 
ExpDate: Format([datefield], "dd.mm.yyyy")
in a vacant field cell in a query, and export that instead > of the field
itself.

I have put it in field cell in a query.
I got an error: "You omited operand or operator, you entered invalid
character or comma, or you entered text without surrounding it in quotation
marks."
Error highlights comma after datefield.

Do you know why?

Thanks for help

Try replacing the comma with a semicolon ; - functions use commas in
American language setting, but semicolons in some other language
settings. If that doesn't work, please open the query in SQL view and
post it here.
 
Try replacing the comma with a semicolon ; - functions use commas in
American language setting, but semicolons in some other language
settings. If that doesn't work, please open the query in SQL view and
post it here.

John W. Vinson[MVP]

Thanks John,

It works, you are genius :)

Regards, Peter
 
Back
Top