SQL server DateTime

Posted on 2007-08-09
Last Modified: 2013-11-07
I have a field (Week_Start_Date) of DataType DateTime (SQL SERVER 2000)
I pass a string from my GUI and in the stored procedure i convert it to MM/DD/YY Format

after the insertion  I get  the value of date along with time "2/8/2007 12:00:00 AM"
I dont want time to be there in the column.

What is that to be done. can it be shown.
Question by:dotnet0824
    LVL 15

    Expert Comment

    You'll need to convert it back into a string in your SELECT query:
    CONVERT(CHAR(10), Week_Start_Date, 101) AS Week_Start_Date

    Author Comment

    does it mean that you cant insert just the date excluding the time.
    LVL 15

    Accepted Solution

    SQL Server does not have a straight DATE or a TIME format. You always have to store the two together and parse out the portion you want (using CONVERT) if you don't want to see both.
    LVL 15

    Expert Comment

    That is what it means.

    Author Comment

    Thanks a lot . i tried it out . works great though.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    Suggested Solutions

    Let's review the features of new SQL Server 2012 (Denali CTP3). It listed as below: PERCENT_RANK(): PERCENT_RANK() function will returns the percentage value of rank of the values among its group. PERCENT_RANK() function value always in be…
    In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
    Via a live example, show how to setup several different housekeeping processes for a SQL Server.
    This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

    779 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

    12 Experts available now in Live!

    Get 1:1 Help Now