SQLTestUser (9/9/2013)
how do we compare a column name "LogDATE" to todays date and if its exists we print out a statement saying the record exists.Ideally we would check the max row and check that the max row has todays date and if it does we print out a statement as " record exist no further action"
thanks
I tried this but it will give me 9/9 and 9/8 i just want 9/9 or just todays date
SELECT LogDATE
from Xlog
WHERE LogDATE >= Convert(datetime, Convert(int, GetDate()))
Convert(datetime, Convert(int, GetDate())) computes to tomorrow's date -
Try this:
Convert(datetime, DATEDIFF(day, 0, GETDATE()))