Hi i can not seem to get the correct formatting/syntax for this statement, its the @tp var (at is throwing it off) it has to be a string in the select statement, any suggestions? I've tried things like:Clients.ID="'@tp'"Clients.ID="'+@tp+'"Clients.ID="')+@tp+('"Clients.ID="')+(select @tp)+('"here is the code (thanks):declare @tp intset @tp = 3012select 'BMI', Result, ExamDate from openquery ([HEALTH REPORTER],'SELECT BMI AS Result, AppraisalDate AS ExamDate FROM Appraisals, Clients WHERE Clients.ID="'@tp'" AND Appraisals.ClientId = Clients.ClientID AND not Appraisals.BMI is null')