I am using a calendar control to pass a date to a stored procedure. The field in the table is a datetime field. Is it possible to extract just the date from the datetime field, or do I have to use multiple Datepart?
WHERE (datepart(mm,sampletimestamp) = month(@selcteddate) and datepart(dd,sampletimestamp) = day(@selcteddate) and datepart(yyyy,sampletimestamp) = year(@selcteddate) )
This works, but I thought there must be an easier way.