>There has to be an easier way to compare just the date of two datetime objects. I found DATEONLY in BOL and was very happy until I tried it and found it was for report builder.
>
>Consider this:
>
>IF (YEAR(@Date1) = YEAR(@Date2) AND MONTH(@Date1) = MONTH(@Date2) AND DAY(@Date1) = DAY(@Date2)) BEGIN
> PRINT 'Same date (I do not care what time it is)'
>END ELSE BEGIN
> PRINT 'Different date'
>END
>
>
>Is there a way to make the IF argument a lot shorter?
>
>Thanks,
>Einar
IF DateDiff(day,@Date1,@Date2) = 0
Cetin