PC Review


Reply
Thread Tools Rate Thread

Retrieve date from database

 
 
michele
Guest
Posts: n/a
 
      4th Aug 2006
Hi, I want to load a listbox with the date that are stored in a database
(mdb), the problem is when I retrieve the date it has a format like
"01/01/2006 0.00.00". In Access the date is stored as short date.
Thanks in advice


 
Reply With Quote
 
 
 
 
Jerry H.
Guest
Posts: n/a
 
      4th Aug 2006
Try this:

dim dtDate as date
dtDate = format(Cdate([AccessDateField]), "MM/dd/yyyy hh.mm.ss")

I'm not 100% sure about this, but even though Access date fields
display as shortdate, I believe the stored value also contains the
Time, and if that is the case, the above code will display what you
need. But if only the Date is stored then the Time stamp portion will
likely return only "12.00.00"

Good luck!


michele wrote:
> Hi, I want to load a listbox with the date that are stored in a database
> (mdb), the problem is when I retrieve the date it has a format like
> "01/01/2006 0.00.00". In Access the date is stored as short date.
> Thanks in advice


 
Reply With Quote
 
 
 
 
michele
Guest
Posts: n/a
 
      7th Aug 2006
I try it and it works fine, thanks


"Jerry H." <(E-Mail Removed)> ha scritto nel messaggio
news:(E-Mail Removed)...
> Try this:
>
> dim dtDate as date
> dtDate = format(Cdate([AccessDateField]), "MM/dd/yyyy hh.mm.ss")
>
> I'm not 100% sure about this, but even though Access date fields
> display as shortdate, I believe the stored value also contains the
> Time, and if that is the case, the above code will display what you
> need. But if only the Date is stored then the Time stamp portion will
> likely return only "12.00.00"
>
> Good luck!
>
>
> michele wrote:
>> Hi, I want to load a listbox with the date that are stored in a database
>> (mdb), the problem is when I retrieve the date it has a format like
>> "01/01/2006 0.00.00". In Access the date is stored as short date.
>> Thanks in advice

>



 
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
Retrieve a the date created date of an Access Table in Excel using VBA neil.smith@bluebottle.com Microsoft Excel Programming 0 22nd Dec 2006 10:25 AM
i have two date fileds Opend date Due date, can i set default on due date so, its always = to open date on my data entry form1 Urgent Mike Saifie Microsoft Access Form Coding 1 9th Mar 2006 02:08 AM
Retrieve only the date of the control date picker Kon Microsoft Access Form Coding 1 16th Oct 2005 11:22 PM
Retrieve date from field with date/time. =?Utf-8?B?UmFq?= Microsoft Access Queries 2 20th Apr 2005 09:03 PM
how do retrieve or restore an exchange server account to retrieve. =?Utf-8?B?Y2hyaXN0b3Bo?= Microsoft Outlook Discussion 2 19th Dec 2004 02:52 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:31 PM.