Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

Time Problem in ASP. Net using an MS Access DB.

Discussion in 'Information Technology' started by Rakesh, Jul 28, 2006.

  1. Rakesh

    Rakesh
    Expand Collapse
    Guest

    Dear All,

    I have used a Access DB containing a time field. I have ensured via
    validation that time entered in the field is in hh:mm format. That is
    working fine. The field type in Table Design mode are set to Date/Time,
    Short Time.

    Problem occurs when I try to display these values using a
    <asp:repeater>. The displayed value contain the correct time portion
    but it also contains the Date at which the entry was made. I want to
    get only the time part. I am using a Jet 4.0 driver and OleDb interface
    to the database.

    How should I patch my query or anything to make it work?

    Thanks.

    Rakesh.
     
  2. Loading...

    Similar Threads Forum Date
    Sikh News Sikhs Face Problems While Carrying Kirpans In Khyber-Pakhtunkhwa - SikhSiyasat.Net Breaking News Jul 29, 2016
    "Dasam" Granth - A Look At The Core Problems Dasam Granth Oct 21, 2015
    Problems In Life Sikh Sikhi Sikhism Apr 13, 2015
    How can I make decent and useful friends and from where ?? most people have a problem with me Sikh Youth Oct 23, 2013
    The Problem with Taking Too Many Vitamins Health & Nutrition Oct 18, 2013

  3. Baz

    Baz
    Expand Collapse
    Guest

    Hiya Rakesh,

    Short Time is not a data type, it is merely a display format. It has no
    effect on what is stored in the field, only how Access displays it. Since you
    are not using Access to display the data, the Access display format is
    irrelevant to you.

    Ideally, you would format the value in your application. However, you can
    also do it in the query, for example:

    SELECT Format(some_date,"hh:mm") AS time_only FROM some_table

    Be aware that the result of this will be a string, not a datetime value.
    "Rakesh" wrote:

    > Dear All,
    >
    > I have used a Access DB containing a time field. I have ensured via
    > validation that time entered in the field is in hh:mm format. That is
    > working fine. The field type in Table Design mode are set to Date/Time,
    > Short Time.
    >
    > Problem occurs when I try to display these values using a
    > <asp:repeater>. The displayed value contain the correct time portion
    > but it also contains the Date at which the entry was made. I want to
    > get only the time part. I am using a Jet 4.0 driver and OleDb interface
    > to the database.
    >
    > How should I patch my query or anything to make it work?
    >
    > Thanks.
    >
    > Rakesh.
    >
    >
     

Share This Page