• I understand the datatype of DATETIME, but thought the point was to truncate the value to just the date, and not give me 00:00:00 at the end. I'm not going to be able to convert to 2K8 anytime soon at work (not up to me, I'm low man on the totem pole)

    Here's what I tried, and what I got:

    SELECT [DateOnly] = CAST(FLOOR(CAST(GETDATE() AS FLOAT)) AS DATETIME) -- CAST / FLOOR / CAST (RESULTS: 2008-02-06 00:00:00.000)

    SELECT [DateOnly] = dateadd(dd,datediff(dd, 0, getdate()), 0) -- DATEADD / DATEDIFF (RESULTS: 2008-02-06 00:00:00.000)

    SELECT [DateOnly] = CAST(CAST(GETDATE() AS INT) AS DATETIME) -- CAST / CAST(RESULTS:2008-02-06 00:00:00.000)

    SELECT [DateOnly] = CAST(CONVERT(CHAR(8), GETDATE(), 112) AS DATETIME) -- CAST / CONVERT(RESULTS:2008-02-06 00:00:00.000)

    Select [DateOnly] = convert(char(10),getdate(),101) --char version, this is the only one that gives me the correct results (RESULTS:02/06/2008)

    ---------------------------------------------------------
    How best to post your question[/url]
    How to post performance problems[/url]
    Tally Table:What it is and how it replaces a loop[/url]

    "stewsterl 80804 (10/16/2009)I guess when you stop and try to understand the solution provided you not only learn, but save yourself some headaches when you need to make any slight changes."