473,461 Members | 1,687 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Retrieve date from database

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
Aug 4 '06 #1
2 1513
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
Aug 4 '06 #2
I try it and it works fine, thanks
"Jerry H." <bo*********@gmail.comha scritto nel messaggio
news:11*********************@m73g2000cwd.googlegro ups.com...
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

Aug 7 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: James Turner | last post by:
I am trying to store formatted text (windows format) into a MySQL database and then retrieve it. The field in the database is a varchar. I cut and paste the test into a form field formatted, then...
16
by: Daniel Tonks | last post by:
First, please excuse the fact that I'm a complete MySQL newbie. My site used forum software that I wrote myself (in Perl) which, up until now, has used flat files. This worked fine, however...
2
by: Rob | last post by:
Hi all, I've got multiple sets of radio button that are dynamically created in code and populated by a database query. The query returns about 20 recordsets with 3 radio buttons per recordset and...
0
by: Luis Esteban Valencia | last post by:
Hi folks, I have a problem using the Calendar Control. Let me explain: On my first page, "Default.aspx", I have a calendar control named "calPrimary". I then have a Web User Control on the...
8
by: tfsmag | last post by:
i need to create a date range based on the current "shown" month on a calendar control to query a database and populate a datagrid based on that date range. how can i retrieve the "shown" month...
2
by: Jeroen Elias | last post by:
Hello, Is it possible to retrieve the date when a record is created in an Access database table? And if so, how can I do that? Thanks in advance, Jeroen Elias
4
by: Simon Gare | last post by:
Hi all, I am trying to retrieve a count of booking entries made 30 days ago, below is the end of the query I am having problems with. dbo.booking_form.TimeOfBooking = DATEADD(day, -30,...
5
by: giandeo | last post by:
Hello Experts. I am unable to retrieve records base on a date. Could you please help me. Here is my code for user to insert a date : <form name="hello" method="post"...
2
by: John | last post by:
I am having trouble getting this code to work, and was wondering if someone could tell me what I am doing wrong. -------------------------------------- CODE--------------------------------------...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.