473,547 Members | 2,532 Online
Bytes | Software Development & Data Engineering Community
+ 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 1526
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*********@gm ail.comha scritto nel messaggio
news:11******** *************@m 73g2000cwd.goog legroups.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
17689
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 call the PHP program to add the record using POST. When I get the text out, it has lost it's formatting. Formatting in the text is achieved by...
16
2980
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 lately I've been wanting to do more stuff with user accounts, and had been eying MySQL for over a year. Finally I've decided to start off small by...
2
5414
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 I want to be able to retrieve the selected value from each of the sets of radio buttons.The names of each group of radio buttons is set by the...
0
1126
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 page that needs to get the calPrimary.SelectedDate property each time the calPrimary.SelectionChanged event fires. So, my web user control is called...
8
1889
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 and year from the calendar control to create this range. Here is what i was thinking, all i need is the "shown" month and year to complete. ...
2
6081
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
3157
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, GetDate()) GROUP BY dbo.booking_form.TimeOfBooking") When I use the = sign the error reads
5
1948
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" action="querytable.asp"> Please enter date (mm/dd/yyyy)<input type="text" name="adate">
2
1663
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-------------------------------------- if (isset($_POST)) { require_once("database.php"); $appt_date = $_POST . '/' . $_POST . '/' . $_POST;
0
7510
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7703
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7947
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7463
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7797
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6032
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5362
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3473
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1050
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.