lambertmule
New Member
I have the following SQL query in an SQLDataSource:\[code\]SELECT stn_ID, stn_Name, stn_Website, stn_IsDestination, stn_NRCode, stn_NRCodeExist, stn_PostCode, twn_ID FROM dbo.tbl_Station AS s WHERE (stn_ID NOT IN (SELECT tds_Stn FROM dbo.tbl_tripDeptStation AS tr WHERE (tds_Trip LIKE @trip_ID))) AND (stn_Name LIKE %@dept_search%)\[/code\]However I receive a syntax error warning:\[quote\] Incorrect syntax near '@dept_search'.\[/quote\]How can I correct the error? I require the \[code\]%\[/code\] symbols to be in front and after the parameter, unless there is an alternative method. If I remove these symbols, the query runs correctly.