Results 1 to 5 of 5
  1. #1
    Join Date
    May 2004
    Posts
    36

    Unanswered: newbe ? re:date format

    Hi, I'm developing a page in asp.net using a sqldb and one of the values I'm sending to the database is a date/time value. I only want the table to show the date in short format, no time. Is there a way to restrict or convert the data in the table design mode?
    Thanks
    Raif

  2. #2
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    SQL Server dates are stored as numeric values that interpreted as dates with time of day. Formatting of output should be handled by your user interface, not the database server.
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  3. #3
    Join Date
    May 2004
    Posts
    36
    Thanks I sort suspected that as I started writing the post.
    Thanks again

  4. #4
    Join Date
    Jul 2004
    Location
    Irvine, CA
    Posts
    7
    Go with a smalldatetime in the sql table so that you are only using a (4). The go with a .ToString() and something like this:
    http://msdn.microsoft.com/library/de...ringtopic4.asp
    Hope it helps.

  5. #5
    Join Date
    Jul 2003
    Location
    San Antonio, TX
    Posts
    3,662
    If you're doing straight SELECT from your ASP, you can use CONVERT(char(10), <your_date_field>, 101) on your date/time field.
    "The data in a record depends on the Key to the record, the Whole Key, and
    nothing but the Key, so help me Codd."

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •