Change Date format

  • Thread starter Thread starter Julie
  • Start date Start date
J

Julie

Hi! I have a table that I have imported into Access. My
dates are broken up into four different fields and I need
to combine those fields. I need my dates to be in the
YYYYMMDD format. My only problem is that my Year, Month,
and Day fields show only one digit when there is a 1-9
used. Example

Century Year Month Day
20 1 5 16
19 98 12 8
19 84 9 20
20 3 10 15

How do I get the Year, Month, and Day to show a 2 digit
field? I need that leading zero to show. Thanks in
advance for any help given! Have a great day!

Julie
 
Create a query into this table.

Type this calculated field into the Field row of your query:
MyDate: DateSerial(100 * [Century] + [Year], [Month], [Day])

You can then format the true date field however you want.
 
This solves my problem. Thanks for your help and have a
great day!

Julie
-----Original Message-----
Create a query into this table.

Type this calculated field into the Field row of your query:
MyDate: DateSerial(100 * [Century] + [Year], [Month], [Day])

You can then format the true date field however you want.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Hi! I have a table that I have imported into Access. My
dates are broken up into four different fields and I need
to combine those fields. I need my dates to be in the
YYYYMMDD format. My only problem is that my Year, Month,
and Day fields show only one digit when there is a 1-9
used. Example

Century Year Month Day
20 1 5 16
19 98 12 8
19 84 9 20
20 3 10 15

How do I get the Year, Month, and Day to show a 2 digit
field? I need that leading zero to show. Thanks in
advance for any help given! Have a great day!

Julie


.
 
Back
Top