Solved Access date field pulling time through as well

Posted on 2011-05-09
Last Modified: 2012-05-11

In 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?
Question by:murbro
    LVL 30

    Expert Comment

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

    Accepted Solution

    LVL 13

    Assisted Solution

    You could use:


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


    Author Comment

    Hi. The GridView is a default control and the SQL Select statement is a Select All. So I am not pulling specifics through

    Author Closing Comment

    thanks for the help

    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    Join & Write a Comment

    This article is a continuation or rather an extension from Cascading Combos ( and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
    A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
    Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
    Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now