DateTime

  • I used datetime datatype in my table.I insert only date but it store the time also.how to avoid storing time.

    And also wen i retrive only data will be displayed into my datagrid

    Pls help me

  • Hello geethag6,

    It's impossible to avoid what you are asking in SQL Server 2000 or SQL Server 2005

    It would be possible in SQL Server 2008 you can test if you install SQL Server 2008 CTP(Not Final yet)!

    But after you create the table and inserting date you will retrieve the data using views or just SELECT statement like this:

    SELECT col1, datecol, CONVERT(VARCHAR, datecol, 103) as Date FROM table_name

    the results will look like this:

    col1 datecol Date

    anytext date(with date and time) dd/mm/yyyy

    Hope this help to you!

    Dugi

    ============================================================
    SELECT YOUR PROBLEM FROM SSC.com WHERE PROBLEM DESCRIPTION =
    http://www.sqlservercentral.com/articles/Best+Practices/61537/[/url]

  • Hi,

    Thank u very much i got the result.

    Regards

    Geetha

  • you are wellcome!

    :hehe:

    ============================================================
    SELECT YOUR PROBLEM FROM SSC.com WHERE PROBLEM DESCRIPTION =
    http://www.sqlservercentral.com/articles/Best+Practices/61537/[/url]

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply