June 7, 2010 at 4:25 pm
I am running the following queries:
SQLstr = "Select Distinct TM from PCTTS_TIME_Results where Dept = " + Me.DropDownListDept.SelectedValue.ToString + " order by TM"
It continues to return the message, "Incorrect syntax near keyword 'order'. Any advice.
Thanks,
Verlin Taylor
June 7, 2010 at 4:54 pm
June 7, 2010 at 5:39 pm
Dept is probably a string, and thus needs to be enclosed in quotes.
SQLstr = "Select Distinct TM from PCTTS_TIME_Results where Dept = '" + Me.DropDownListDept.SelectedValue.ToString + "' order by TM"
^ ^
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
June 7, 2010 at 9:28 pm
That was it.
Thanks,
Verlin T.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply