Date and Time query

Discussion in 'ASP .Net' started by Paul Evans, Dec 19, 2004.

  1. Paul Evans

    Paul Evans Guest

    Hi,

    I have created a datagrid which works just fine. One of the columns
    retrieves the date which particular row was populated. However, the format
    which the date is returned is:

    19.12.2004 13:03:25

    I only want to display the date that the row was populated, not the exact
    time as well. Is there anyway I can do this, or is it an SQL problem when I
    first created the table? I'm using a microsoft SQL server. The date is
    generated automatically when a row is added to the table.

    Thanks for your time

    Paul Evans
     
    Paul Evans, Dec 19, 2004
    #1
    1. Advertising

  2. Paul Evans

    Shawn Guest

    Is the date comming from a date field in your DB?
    In that case you can format the date in your sql select statement.
    Another method is to get the date for each row in ItemDataBound. Get the
    date from you label/textbox and put it into a date variable, then save the
    value back to the label/textbox using the method you want your date
    diplayed. yourDateVariable.ToString("dd.MM.yyyy")

    Hope this helps.
    Shawn



    "Paul Evans" <> wrote in message
    news:%23ezw$...
    > Hi,
    >
    > I have created a datagrid which works just fine. One of the columns
    > retrieves the date which particular row was populated. However, the

    format
    > which the date is returned is:
    >
    > 19.12.2004 13:03:25
    >
    > I only want to display the date that the row was populated, not the exact
    > time as well. Is there anyway I can do this, or is it an SQL problem when

    I
    > first created the table? I'm using a microsoft SQL server. The date is
    > generated automatically when a row is added to the table.
    >
    > Thanks for your time
    >
    > Paul Evans
    >
    >
     
    Shawn, Dec 19, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Matt
    Replies:
    1
    Views:
    610
    Matthew Speed
    Nov 8, 2003
  2. Chris Berg
    Replies:
    0
    Views:
    797
    Chris Berg
    Oct 27, 2003
  3. Peter Grison

    Date, date date date....

    Peter Grison, May 28, 2004, in forum: Java
    Replies:
    10
    Views:
    3,285
    Michael Borgwardt
    May 30, 2004
  4. Keith Cochrane
    Replies:
    2
    Views:
    626
    Keith Cochrane
    Aug 6, 2006
  5. Summu82
    Replies:
    5
    Views:
    872
    Richard Heathfield
    Jun 7, 2006
Loading...

Share This Page