Hello gurus -
I am writing a stored procedure where I need to compare a date to a datetime
field.
For example, part of my WHERE clause is:
WHERE date_enrolled = @current_admit_date
(date_enrolled is the system stored datetime field, and @current_admit_date
is my variable, which will be input as mm/dd/yyyy)
For my purposes, 11/03/2005 is equal to 2005-11-03 17:00:00.000, or any
other time on that day. I just need to lop off the time. I imagine I would
have to use CAST or CONVERT on date_enrolled, but I can not seem to make
this work.
Thanks,
Craig Comperatore, CNE, MCP, CCNA, A+, Net+
IT Site Coordinator, Baycare - the Harbor BHCI
Phone: (727) 841-4200 x 248
Fax: (727) 841-4203
Confidential: This electronic message and all contents contain information
from BayCare Health System which may be privileged, confidential or otherwise
protected from disclosure. The information is intended to be for the addressee
only. If you are not the addressee, any disclosure, copy, distribution or use
of the contents of this message is prohibited. If you have received this
electronic message in error, please notify the sender and destroy the original
message and all copies.
MS Sql Server LazyDBA home page