I am wondering if it is possible to use a variable as a column name in a query within a stored proc? This is what I am trying:<BR>Create procedure word<BR>(<BR> @optin Varchar(50),<BR> @DATE1 smalldatetime,<BR> @DATE2 smalldatetime<BR>)<BR>AS<BR>DECLARE @arg VARCHAR(50)<BR>SELECT @arg = @optin<BR>BEGIN<BR>SELECT email, regtime INTO #rEmail<BR> FROM registrations<BR> WHERE regtime >= @DATE1 AND regtime <= @DATE2 AND NOT IN <BR> (SELECT email FROM registrations WHERE regtime < @DATE1)<BR>SELECT DISTINCT(email) FROM #rEmail WHERE email IN <BR> (SELECT email FROM contestants WHERE @arg = 'y')<BR>END<BR><BR>So in the final select statement ...WHERE @arg='y') is where I error out. If I hard code this it works just as it should. Anyone know if this can be pulled off? Thanks in advance for your help.