How to remove the date part of a Date/Time value in MS Access

I am inserting a time value into a MS Access Date/Time field and notice that MS Access does not display the date portion of the value but when I look at the same data in my programming using a TADOTable component I am seeing the date of 12/30/1899 in conjunction with my time value.

I read that Access is handling this within MS Access so that when a 0.sometime value is inserted it does not display the date. How do I handle this within my Delphi program so that I can display the time only in a Date/Time type field?
0
Jeff
12/9/2008 6:44:47 PM
embarcadero.delphi.ado 597 articles. 1 followers. Follow

1 Replies
995 Views

Similar Articles

[PageSpeed] 47

Jeff Howard wrote:
> I am inserting a time value into a MS Access Date/Time field and
> notice that MS Access does not display the date portion of the value
> but when I look at the same data in my programming using a TADOTable
> component I am seeing the date of 12/30/1899 in conjunction with my
> time value.
> 
> I read that Access is handling this within MS Access so that when a
> 0.sometime value is inserted it does not display the date. How do I
> handle this within my Delphi program so that I can display the time
> only in a Date/Time type field?

If using persisent fields, you can set the DisplayFormat property for 
that field to something like hh:nn.  Some components also have a 
DisplayFormat property, so you may be able to set it there instead.
-- 
Jon Purvis
Wildlife Data Analyst
Texas Parks and Wildlife Department
Austin, TX
0
Jon
12/9/2008 8:30:31 PM
Reply:

Similar Artilces:

remove time part from a date/time field value
How does one remove or avoid the time part from a date/time field value. For example store 12/12/2006 instead of 12/12/2006 12:00:00 Am --------------------------------------------------No Project Too Eazy.-------------------------------------------------- You can use one of the appropriate Standard DateTime Format Strings such as d or D.Darrell Norton, MVPDarrell Norton's BlogPlease mark this post as answered if it helped you! You should be able to use DateTime dt = DateTime.Now dt.ToString("d")  //this will format as short date time FYI: If you want to do it at the query ...

Retrieve Only Date from Date/Time in Ms Access
Hello,When retrieving data from an ACCESS database table, I want the generated ASP page to display only the date inputted by the user. It currently displays the date and then the time is always 12:00. Anyone have any suggestions as how I can have it display only the time, but leave the access format as Date/Time? Format the output - use {0:d} Something like:label1.text=String.Format("{0:d}",YourDate)David WierMCP/ASPInsiderASPNet101.com - where to look first!Please Vote for ASPNet101 - 'Best Community Resource'!Control Grouper - easily control properties for multipl...

DBI, MS Access, inserting/updating a Access Date/Time value
Hi, Does anyone have any idea what is up with Microsoft Access and its ridiculous Date/Time formatting options? It doesn't seem to matter what format I attempt to insert with. The directory and db file permissions are all Full Control. I'm using the "#" around the Date/Time format as required. The database has nothing as the Format in Design view on the General tab. The insert below has never worked once. On the up side if I run an insert that has no mention of the Date/Time field then it will just insert the record using the =Now() function as the default va...

Dates, Dates, Dates!
Hello all... I am in the process of building an appointment system, and I am trying to see if I can get some pointers on which way to go on this. The first version of this appointment system was very lo-tech, and it stored all of the possible dates/times in the database. Once a user booked an appointment, their information was logged to that date/time, and then that date/time would no longer show in the list of possible openings. This was great for a temporary fix, but with having to pre-populate all of the dates/times, the system would eventually have to be updated to continue on pa...

date/time or date and time
I am setting up an SQL database and I will need to get differences in dates. For example I have a start date, start time, completion date and completion time and I want to get the difference between the start and completion. Would it be better to have one field with both date and time in it, or better to have a date field and a time field? Even though I have already started setting up the tables with seperate fields for date and time I am now leaning toward one field with date/time in it. (Only because that is the way I had to do it when setting up an Excel spreadsheet for a similar ta...

Date entered...add time value to make date/time field
Windows XP Professional InfoMaker v 9.0.2 Build 7509 Our database contains a date/time stamp for when a specific activity happens to each shipment. I would like the users to be able to simply enter a date for a specific work day. I need to get a list of shipments where the time of one activity occurred on the entered date prior to 9:20. How can I create a computed field that will basically concatenate/amend the entered date with 9:20 that will later be used for criteria in returning rows? Thanks in advance for any help you can provide! Rita Palazzi Senior Engineer /...

Inserting Date into Access Date/Time Field
Everytime i capture a date from an asp:dropdownlist and try to insert it into an access date/time field i keep getting a Data type mismatch in criteria expression error (0x80040e07). is there a way i need to format the data before inserting? Any help would be ace!1 using System; 2 using System.Data; 3 using System.Data.OleDb; 4 using System.Configuration; 5 using System.Web; 6 using System.Web.Security; 7 using System.Web.UI; 8 using System.Web.UI.WebControls; 9 using System.Web.UI.WebControls.WebParts; 10 using System.Web.UI.HtmlControls; 11 12 ...

Formatting date SQL date to remove time
Hi,I need a way of changing the following SQL statement so that the dates are without the hh:mm:ss tt:"Select DISTINCT([StartDate]) From [Events]"How can this be done?Thanks,Curt. Regards, Curt SELECT CONVERT (VARCHAR, [StartDate], 101) FROM ... For other date formatting types, see http://msdn2.microsoft.com/en-us/library/ms187928.aspxMark replies as answers if they helped you solve the problem. use the following Conversions Convert("urdatecolumn",Varchar,101); and there are more codes for the dateconversions.Its general Syntax is Convert("urdatecolumn",...

Date and Time in MS Access
Hi! I write my third ASP.NET project. It's a customer survey. The data will be stored in an Access-database, which shall contain the client data and additional the Date/Time of the entry. Here is my INSERT-function:Function Survey_Insert(ByVal projektnummer As String, ...) As Integer    Dim connectionString As String = "Provi...Survey.mdb"    Dim dbConnection As System.Data.IDbConnection = New System.Data.OleDb.OleDbConnection(connectionString)    Dim Zeit as New DateTime    Dim queryString As String = "INSERT INTO [Erge...

Remove the time part from a date
Hello, I have a datatable with a column of dates and times -  xx/xx/xxxx 12:00:00 AM I want to remove the12:00:00 AM Below is two For next loops I tryed with no luck.  I even tryed to cast the listitem.text to a date and it still didn't  work. Thanks Steve Dim i As Integer = 0 For i = 0 To ds.Tables(0).Rows.Count - 1 Dim li As ListItem = ds.Tables(0).Rows(i).Item(0) Format(li.Text, "MM/dd/yyyy") Next   Dim i As Integer = 0 For i = 0 To ds.Tables(0).Rows.Count - 1 Dim li As ListItem = ds.Tables(0).Rows(i).Item(0) Microsoft.VisualBasic.Left(li.Text, 10) Next...

Accessing Date and Time Values
Hi there. I would like to display date and time on my web application. Each label shows one info: lblMonth ---> displays current Month (e.g. Jan,Feb,Mar and so on) lblDayNo ---> displays current DayNo (e.g. 1,2,3 and so on) lblDay ---> displays current Day (e.g. Monday,Tuesday and so on) lblTime ---> displays current Time where the time is updated every minutes My code goes like this: Dim strMonth As New Date() Dim strDayNo As New Date() Dim strDay As New Date() Dim strtime As New DateTime() lblMonth.Text = strMonth.Month.ToString lblDayNo.T...

Access Date/Time value
hi, i'm a new user of asp.net. my post may have the same title as others, but i still can't find the solution to my problem. ok here's my problem. i have a dropdownlist, where user's can select the time from. example of my list: text = 8:00, value = 8 in the database, the field 'time' has been set to date/time datatype.  this is my coding:         dsSchedule.Schedule.Clear()         daSchedule.Fill(dsSchedule)         Dim dr As DataRow = dsSchedule.Tables(0).NewRow()  &nbs...

How to compare Calendar Control Dates to MS Access Dates?
I am trying to use TodaysDate from calendar control of ASP.Net to query a MS Access DB & retrieve records that satisfy the condition of today's date falling within a specified range. My ASP.NET script reads: sql="SELECT * FROM calendar WHERE ( " + Calendar1.TodaysDate + " BETWEEN date_start AND date_end)" date_start and date_end are both using the TIME/DATE (General Format) in MS Access. I tried to run the query but it return an empty result even though today's date falls within the range of date_start and date_end, eg: Calendar1.TodaysDate is 5/6...

java date time and utc date time
hi i have a client written in delphi the backend is written in java (webservice) when fetching a date field from the db, through java to delphi (TXSDateTime class), for some reason the date changes. in the db: 30/07/2009 00:00:00 in delphi: xsdatetime.asdatetime = 29/07/2009 23:00:00 (1 hour before) in delphi xsdatetime.asutcdatetime = 29/07/2009 21:00:00 (3 hours before) i guess it's a matter of timezones but all we want is simply to fetch the same date as it appears in the DB what are we missing? thanks amos szust wrote: > hi > > i have a client written in d...

Web resources about - How to remove the date part of a Date/Time value in MS Access - embarcadero.delphi.ado

ADL To Facebook: Remove Jewish Ritual Murder Page
... again found itself in the “damned if you do, damned if you don’t” conundrum caused by controversial subject matter , being pressured to remove ...

Platform Updates: New User Object fields, Edge.remove Event and More
New User Object fields, Edge.remove event, and more

Now Users Can Remove Contacts Automatically Saved by Facebook’s Friend Finder
Two weeks ago, many Facebook users began asking questions about curiously good recommendations suddenly appearing in Facebook’s “People You May ...

I Can Be Fearless - Relax, remove fear and Anxiety on the App Store on iTunes
Get I Can Be Fearless - Relax, remove fear and Anxiety on the App Store. See screenshots and ratings, and read customer reviews.

Royal commission finds Marist failed to remove paedophile Brother John Chute
Marist's failure to act on notorious paedophile allowed abuse to continue, Royal Commission finds.

New York Times Removes Reference to President Obama and Cable News
... (@NoahCRothman) December 18, 2015 The Times story was published Thursday, but by Friday morning, the reference to cable news was quietly removed, ...

New Stars Wars toy leaks early, Lucasfilm tries to remove it from the Internet
The long tentacles of Lucasfilm's Intellectual Property arm are pretty much impossible to avoid, a fact a couple of Star Wars fans from Iowa ...

China's Stabilizing Economy Removes Rate Rise Hurdle for Fed
China’s latest round of economic data showed fresh evidence of stabilization after policy makers unleashed several rounds of monetary and fiscal ...

Why Apple might want to remove the home button from the iPhone
Gene Munster of Piper Jaffray explains how the iPhone could be improved without the home button. Produced by Justin Gmoser . Additional camera ...

​New Orleans votes to remove Confederate monuments
After months of heated debate, city council votes 6-1 to take down monuments, including a towering statue of Confederate Gen. Robert E.

Resources last updated: 12/20/2015 5:36:04 PM