DateTime

F

Francisco

Hello
I have this sentence:
ALTER TABLE Anexos ADD Date1 datetime

But i need to use a Format (dd/mm/yyyy)

What should i do?

Thanks
 
D

Douglas J. Steele

Dates in Access do not have a format: they're stored as 8 byte floating
point numbers, where the integer part represents the date as the number of
days relative to 30 Dec, 1899, and the decimal part represents the time as a
fraction of a day.

Regardless of what your short date format has been set to through Regional
Settings, you'll still going to have to use mm/dd/yyyy (or an unambiguous
format such as dd-mmm-yyyy or yyyy-mm-dd) in SQL statements: if you try to
use dd/mm/yyyy, the date will be misinterpretted any time dd is 12 or less.

Once you have your dates in the database, put a Format on the field to
display it however you want.

You might find Allen Browne's "International Dates in Access" at
http://users.bigpond.net.au/abrowne1/ser-36.html useful reading.
 
K

k3dragon

Hi,

You can't modify format property by SQL statement
If you want to change the format of field,
open table in design mode and put the "dd/mm/yyyy" into format propery box.
Another way is using VBA and tabledef object.
 

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