• Convert(datetime, DATEDIFF(day, 0, GETDATE())) worked

    IF EXISTS(

    select 1 from Xlog where LogDATE >= cast(getDate() as date) -- should this be datetime if i have Sql server 2005?

    )

    then PRINT 'Record already exists.' ;

    results in an error as

    Msg 156, Level 15, State 1, Line 4

    Incorrect syntax near the keyword 'then'.