I have one procedure
Create procedure [dbo].[daily_stats]
@date datetime, @grouping varchar(150)
as
select callid,campaignid,dnis,anidigits,callstarttime,totalcalltime,agenttalktime,agentid,abandon,queuewaittime,calltype,call_acw,datestamp,bill_flag,
queueid,queuename,calldelayed, callholdtime, shortcall,ctr_name,role_name,team_name,callhold_times,agent_fullname,xferto,timeafterxfer,
obcallids,obcalls,obtime,orgname, getdate() as ImportedDate
into #tempid7
from openquery(orapr2, 'select * from sp_calldetail
where trunc(callstarttime) >= trunc(sysdate-1) and abandon in (0,1) and (upper(campaignid) in (''SYNAPSE'', ''SYNAPSECALLBACK'') or campaignid like ''ME%'')')
I want to pass @date
value at trunc(sysdate-1)
. How do I do that?