View Full Version : Assigning a variable to "LIKE" condition search string


pikachew
01-26-2005, 05:11 AM
Hi can anyone help me with this query?

'SQLTable "Resolutions Per Year", "SELECT ResName, COUNT(ResName) AS Total FROM Stats LEFT JOIN Resolutions ON (Stats.UserID = Resolutions.UserID AND Stats.ResID=Resolutions.ResID) WHERE Stats.UserId = '"&login&"' AND Date LIKE '%sYear%' GROUP BY Stats.UserID, ResName ORDER BY COUNT(ResName) DESC"

sYear is a variable
example sYear = 2003,2004,2005....

This does not work.
Is there anyway to assign the search string to be a variable?

FoFa
01-26-2005, 06:58 AM
Didn't you post this in the Genral forum?

pikachew
01-26-2005, 07:28 AM
Sorry will restrict to General from now onwards