Re: Date format issue
- From: fredg <fgutkind@xxxxxxxxxxxxxxx>
- Date: Wed, 6 Dec 2006 14:15:40 -0800
On Wed, 6 Dec 2006 12:20:01 -0800, CHWRoma wrote:
I knew I wasn't being clear. I'm not sure how to explain the issue. The
data comes from an outside source in excel format. When I get it the date
format is numbers (i.e. 45488). When I format it in excel it will show as
7/15/24 but it is actually 7/15/2024. Then when I import to Access it comes
in as 7/15/2024. I need to be able to change it to 7/15/1924.
Thanks again,
CHW.Roma
"CHWRoma" wrote:
I am not sure this is the discussion group I need but I don't see any other
that fits.
I have an excel file that has the DOB date coming in as 1/1/2055, instead of
1/1/1955. I can fix it in excel but when I bring it into Access it still
exists the old way. Is it possible to write something using our system date
"Now()" to change it back to the correct format?
Thank you,
CHW.Roma
Well, you're still not being clear.
Note:
Since Year2K, Access and Excel assume any date entered with a 2 digit
year of 00 to 29 will be a 21st century year, i.e. 2029. Any 2 digit
year entered from 30 to 99 will be assumed to be a 20th century year,
i.e. 1999.
If this is creating a problem for you (and it seems to be) do NOT use
a 2 digit year for data entry. Enter dates as 7/24/1924 so Access and
Excel don't have to assume anything.
In Access, as well as in Excel, the value of 45488 as a Date value is
7/15/2024.
If you wish to change that value then run an update query after you
import the data. Make sure the field's datatype is Date/Time.
Update YourTable Set YourTable.DateField =
DateAdd("yyyy"-100,[DateField])
For example, the value of 45488 will then be stored as 8963 (the Date
value of 7/15/1924).
The above will change the VALUE of ALL records in that DateField.
If you wish only certain records changed, then add a where clause to
the above. For example:
Where [DateField]> Date()
will change only those records that are in the future.
If you simply wish to change how the field displays the date, (as
7/15/24), write:
m/d/yy
in the field's Format property line. But that just changes what you
see, the underlying value is still 7/15/2024.
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
.
- Follow-Ups:
- Re: Date format issue
- From: CHWRoma
- Re: Date format issue
- Prev by Date: Re: deleting columns in table
- Next by Date: Re: deleting columns in table
- Previous by thread: Re: Date format issue
- Next by thread: Re: Date format issue
- Index(es):
Relevant Pages
|