Retrieve Only Date from Date/Time in Ms Access


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?

1/30/2008 3:55:59 PM 91979 articles. 4 followers. Follow

6 Replies

Similar Articles

[PageSpeed] 29

Format the output - use {0:d}

Something like:

David Wier
MCP/ASPInsider - where to look first!
Please Vote for ASPNet101 - 'Best Community Resource'!
Control Grouper - easily control properties for multiple controls with one control!
Calendar Express - The Best HTML Calendar Generator on the web!
(Please 'Mark as Answer' when it applies)
1/30/2008 4:01:04 PM

 Thanks for the advice.

I'm still stuck on ASP and not .NET

This is the line of code in my table.

<td> <%=rs("Date_Posted").value%></td>  

It's able to display the information thats stored in the ACCESS database, but for format reasons, I have used Date/Time instead of Text. How would one display on the date in this situation?

Thanks again! 

1/30/2008 4:08:37 PM

 Check this link for the answer

"Hokey religions and ancient weapons are no match for a good blaster at your side."
1/30/2008 4:11:16 PM

those examples only show how to display today's date. I want the asp page to display the information that the user added via a form, and was saved in an access table.

Because the data value is Date/Time, it displays the value as:

1/13/2006 12:00:00 AM

11/7/2007 12:00:00 AM

1/29/2008 12:00:00 AM


I want ONLY the date displayed, not the time, as the time was never inputted. Sorry if I sound repetitive, as you guys can tell I'm not that good at this...

Thanks again everyone for your help! 

1/30/2008 4:21:18 PM

my mistake - however, this IS an ASP.Net forum - not Classic ASP - check out this page:

David Wier
MCP/ASPInsider - where to look first!
Please Vote for ASPNet101 - 'Best Community Resource'!
Control Grouper - easily control properties for multiple controls with one control!
Calendar Express - The Best HTML Calendar Generator on the web!
(Please 'Mark as Answer' when it applies)
1/30/2008 4:38:00 PM

 Apparent;y you didn't read down far enough. VBShortDate is the format you want that will only display THE DATE, without time.

"Hokey religions and ancient weapons are no match for a good blaster at your side."
1/30/2008 5:06:06 PM

Similar Artilces:

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? Jeff Howard wrote: > I am inserting a time value into a MS Access Date/T...

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...

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 ...

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...

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...

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...

calendar date span (date start : date end)
Hi! Can anyone help me with this? Say, I have these two textboxes. Date Start:        Date End:             What I wanted to do is to put dates on it using the calendar. My problem is I do not know what to do to keep the "Date Start" not way after the set "Date End", and for "Date End" not way before the set "Date Start".   example: Date Start: July 1, 2008              &nb...

From Date and To Date
 In my application i have two textboxes.One for From date and the other one for To date.I need to check whether the From date is lesser than To Date..Date formats will be either(DD-MM-YYYY) or (DD/MM/YYYY).and i have used calendar extender for selecting dateI need the script code to do this...Thanks in advance See this thread: Naeem"Please mark as answer if it helped you"  <form id="form1" runat="server"> <asp:ScriptManager ID="ScriptManager1" runat="server"> </...

Retrieve Only Date from DateTime in Ms Access
Hi    Iam using Ms Access & Visual Basic Web Express Edition and i want to display only date in Gridview but it displays both date and time . Could anyone please suggest me to retreive only date from datetime in Ms Access. Go to Edit Columns in the GridView Smarttag, select the date column, in the property DataFormatString, add the following {0:d}...

Problems with MS Access Date Time
I am using PB 701 with a Microsoft Access Database. Whenever I try to update a data window with a date time column in it I get an syntax error message on theupdate or insert statement. It is trying to insert the datetime in the form {ts 2001-12-02 }. Any help would be greatly appreciated. Edney Holder In the pbodb70.ini file you specify the format that PB7 will use. Check the [Access] section. Mine is set to: PBDateTime='NO_MSECS_DATETIME' Now look further down in the file and find the section ; **************************************************...

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...

from date to date
I am working on a form for livestock. one of the things in the form is a checkbox to let me know if they qualify or not. the second is I have a created record field entered into the database... now my question is I am doing a search on this and cant figure it out since i am new to all this...i have a query that selects the qualification checkbox (where qualify = 'true') then another query that selects the created record date... and the search is that I want to get the information in the livestock that are qualifyed (have the checkbox qualify = to 'true') between  one dat...

Hello There!,          First of all i have a date column and a text box column in my datagrid . i am populating the date column through the below code  DataTable Table3 = new DataTable();         DataColumn Date = new DataColumn();        Date.ColumnName = "Date";   Table3.Columns.Add(Date);  DateTime Crnt_Time =DateTime.Now;        int day = Crnt_Time.Day;        int mnth = Crnt_Time....

Web resources about - Retrieve Only Date from Date/Time in Ms Access -

Facebook Developers Can Retrieve Users’ Profile Pictures In Different Sizes
Facebook introduced a way for developers to retrieve users’ profile pictures for use within their applications in different sizes, rather than ...

Winston retrieves the news
... food and losing weight. Three months ago, we were told he had lymphosarcoma of the GI tract. On March 10, 2008, Winston was called to go retrieve ...

Gizzard uses a rope to retrieve a submerged gift, 10 second retrieval from noticing the rope - YouTube ...
This is the second attempt, and the second occurrence he has ever seen this contraption. Without the rope, he would probably drown to retrieve ...

Dutch backpacker paid $5 an hour to retrieve golf balls from lakes
A Dutch backpacker claims he was paid as little as $5 an hour to wade through murky ponds and lakes retrieving thousands of lost golf balls. ...

People Are Willing To Go To Extreme Lengths To Retrieve Their Stolen Smartphones
People are willing to pay a ton of money and potentially put themselves in danger to retrieve their stolen smartphones, a new survey has found. ...

Police officer shot at 'very large' shark to retrieve body of swimmer
A policeman who shot a shark in a bid to retrieve the body of a swimmer it had killed says his first bullets disintegrated as they hit the water ...

Divers retrieve body from NSW floodwaters
A woman's body has been retrieved from a submerged car in a creek in Maitland.

Tourist plunges to death from Potts Point rooftop park trying to retrieve football: police
A French tourist who fell to his death from a rooftop park in Potts Point in inner Sydney was attempting to retrieve a football that had gone ...

The art of war: Quest to retrieve what Nazis stole
Susan Fisher Sullam tells of learning her father was a wartime treasure hunter, tracking down what the Nazis had plundered from Holocaust victims. ...

Investigators retrieve more human remains at MH17 crash site in eastern Ukraine but wreckage cannot yet ...
Dutch forensic experts recover further human remains at the crash site of downed flight MH17.

Resources last updated: 1/20/2016 12:00:19 AM