PC Review


Reply
Thread Tools Rate Thread

dates in access

 
 
Jerry Kinder
Guest
Posts: n/a
 
      9th Sep 2006
Help I am lost!

I imported a csv file into Excel then into Access with one column of dates.
In the csv file the dates are just numbers, I am assuming they are cereal
numbers for the dates?? How do I get them back to dates in access? I
imported first to Excel and tried to format them as dates but they remain
numbers. Then imported them to Access. In access I can not get them to
convert to dates either. LOST.

Thanks,
Jerry


 
Reply With Quote
 
 
 
 
Ken Snell \(MVP\)
Guest
Posts: n/a
 
      9th Sep 2006
If the numbers are five-digit integers, then they probably are the numeric
representation of the date.

You can convert them to the "date" by using this expression:

CDate([FieldName])

where FieldName is the name of the field that holds the numbers.

You can use this expression in a query that appends the data to another
table, or you can use it to update a date field in a tale via an update
query. Tell us more about what you want to do with the date when you get it
converted.

--

Ken Snell
<MS ACCESS MVP>

"Jerry Kinder" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Help I am lost!
>
> I imported a csv file into Excel then into Access with one column of
> dates.
> In the csv file the dates are just numbers, I am assuming they are cereal
> numbers for the dates?? How do I get them back to dates in access? I
> imported first to Excel and tried to format them as dates but they remain
> numbers. Then imported them to Access. In access I can not get them to
> convert to dates either. LOST.
>
> Thanks,
> Jerry
>
>



 
Reply With Quote
 
Jerry Kinder
Guest
Posts: n/a
 
      9th Sep 2006
Hi Ken,
There are eight digits - 11302006 - in each cell of the column. It is the
"Renew Date" for a club roster. It would be helpful to know when each
member last renewed their membership. What do you think this number might
be if not a date? The Col Hedder is "RenewDate"

How do I do an update query? - "you can use it to update a date field in a
table via an update query".

Thanks, Jerry


"Ken Snell (MVP)" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> If the numbers are five-digit integers, then they probably are the numeric
> representation of the date.
>
> You can convert them to the "date" by using this expression:
>
> CDate([FieldName])
>
> where FieldName is the name of the field that holds the numbers.
>
> You can use this expression in a query that appends the data to another
> table, or you can use it to update a date field in a tale via an update
> query. Tell us more about what you want to do with the date when you get

it
> converted.
>
> --
>
> Ken Snell
> <MS ACCESS MVP>
>
> "Jerry Kinder" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > Help I am lost!
> >
> > I imported a csv file into Excel then into Access with one column of
> > dates.
> > In the csv file the dates are just numbers, I am assuming they are

cereal
> > numbers for the dates?? How do I get them back to dates in access? I
> > imported first to Excel and tried to format them as dates but they

remain
> > numbers. Then imported them to Access. In access I can not get them to
> > convert to dates either. LOST.
> >
> > Thanks,
> > Jerry
> >
> >

>
>



 
Reply With Quote
 
Douglas J. Steele
Guest
Posts: n/a
 
      10th Sep 2006
If I had to guess, I'd say that was 30 Nov, 2006. Sure looks like mmddyyyy
to me!

Assuming I'm correct, try:

Function ConvertToDate(IntegerDate As Long) As Date

Dim intDay As Integer
Dim intMonth As Integer
Dim intYear As Integer

intMonth = IntegerDate \ 1000000
intDay = (IntegerDate Mod 1000000) \ 10000
intYear = IntegerDate - (intMonth * 1000000&) - (intDay * 10000&)

ConvertToDate = DateSerial(intYear, intMonth, intDay)

End Function

If you're positive that every user will have their Short Date format set to
mm/dd/yyyy through Regional Settings, you could use the following instead:

CDate(Format(IntegerDate), "00\/00\/0000"))

(but I'd recommend against making that assumption!)

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"Jerry Kinder" <(E-Mail Removed)> wrote in message
news:ug2h$(E-Mail Removed)...
> Hi Ken,
> There are eight digits - 11302006 - in each cell of the column. It is the
> "Renew Date" for a club roster. It would be helpful to know when each
> member last renewed their membership. What do you think this number might
> be if not a date? The Col Hedder is "RenewDate"
>
> How do I do an update query? - "you can use it to update a date field in a
> table via an update query".
>
> Thanks, Jerry
>
>
> "Ken Snell (MVP)" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> If the numbers are five-digit integers, then they probably are the
>> numeric
>> representation of the date.
>>
>> You can convert them to the "date" by using this expression:
>>
>> CDate([FieldName])
>>
>> where FieldName is the name of the field that holds the numbers.
>>
>> You can use this expression in a query that appends the data to another
>> table, or you can use it to update a date field in a tale via an update
>> query. Tell us more about what you want to do with the date when you get

> it
>> converted.
>>
>> --
>>
>> Ken Snell
>> <MS ACCESS MVP>
>>
>> "Jerry Kinder" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>> > Help I am lost!
>> >
>> > I imported a csv file into Excel then into Access with one column of
>> > dates.
>> > In the csv file the dates are just numbers, I am assuming they are

> cereal
>> > numbers for the dates?? How do I get them back to dates in access? I
>> > imported first to Excel and tried to format them as dates but they

> remain
>> > numbers. Then imported them to Access. In access I can not get them to
>> > convert to dates either. LOST.
>> >
>> > Thanks,
>> > Jerry
>> >
>> >

>>
>>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Corrupted Dates in Access Link Tables - Linking Access to Outlook( Agent 99 Microsoft Access External Data 0 29th Aug 2009 09:22 AM
Dates in Access =?Utf-8?B?S0JW?= Microsoft Access 2 15th Aug 2006 01:54 PM
Excel Dates to Access Dates (Julian) Michael Kintner Microsoft Access 3 28th Sep 2005 02:01 PM
Access and Dates Tina Korncavage Microsoft Access Getting Started 2 13th Jun 2004 06:12 AM
Access Dates and ASP rp Microsoft Access 1 1st Apr 2004 01:00 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:51 AM.