I am writing some query from winforms. I am getting error with the following query:
string query = "Select [Doctor Name], Day, DateTime, Med_Sur from Doc_Pat_App where (lower([Patient Name])= '" + name + "') and (DateTime >= GetDate()))";
I know that there is no mistake till lower() function, my mistake is in DateTime >= GetDate() Comparison. Can anybody figure out how can I correct the syntax? my 'DateTime' column is of datatype 'datetime' in sql. Please don't confuse this column name with built-in one.
And one thing more that I want to just compare the date portions of both? Am I doing right or I should use Convert() Function?
I am using sql server 2005.