ASP.net Access date field pulling time through as well

Hi

In ASP.net I am using a GridView to view data from an Access table.
The date field, which is formatted as "sort date" in Access pulls through the
time as 12:00:00 AM as well. How do I stop this?
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAsked:
Who is Participating?
 
MlandaTCommented:
If you're using a BoundField, simply do as follows:
<asp:boundfield datafield="Your_Date_Column" dataformatstring="{0:dd/MMM/yyyy}" htmlencode="false" />

Open in new window

Just make sure you set the HtmlEncode attribute to False or it won't work.
0
 
RickCommented:
You could use:

   DateValue(DateField)

Or if you think your date field might contain null values, use this:

   IIF(IsDate(DateField),DateValue(DateField),Null)
0
 
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAuthor Commented:
Hi. The GridView is a default control and the SQL Select statement is a Select All. So I am not pulling specifics through
0
 
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAuthor Commented:
thanks for the help
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.