I am trying to run a SQL Query in ALM12 like the following select count(*) from sample where name = 'sam' and date = '01/01/15' Is there any way i can assign the values (sam, 01/01/15) to variables and use them in the query ? After some searching i tried the following, but its not working; getting QC cannot run the query because it contains invalid arguments... DECLARE @name varchar(20) set @name = "sam" Kindly help.
What you have listed should work. Your query would then be DECLARE @name varchar(20) SET @name = 'sam' select count(*) from sample where name = @sam and date = '01/01/15' If you want date as a parameter you would include an DECLARE @date and SET @DATE = '01/01/15' and use @date in the query.