Hi
I have Datetime Field in which data is stored in this format 2011-09-02 06:32:00 (Year,Month,Date) . I want if entry exists for that user on that day , then it should allow only to update , else it should allow me to add record.
For e.g (Select * from table1 where date = m_date)
if record is returned then message ("Entry Exists") else ("Entry Does not Exist"); Query should check only for date in that field.
Thanks
Loading
Satish BhatPosted Sep 5, 2011, 4:49 AM
Select * from table1 where CONVERT(VARCHAR(10),DATE_FIELD_NAME,101) = m_date
pass m_date in MM/dd/yyyy format [in c# by calling m_date.ToString("d")]