I would like to set a variable to a result of a query to the database.
Is this possible and how do I do this?
The reason for this is I actually have a SQL Select statement that will be running to get results. The sql query uses a paramter when it's run. The parameter will be a value based on anohter query. Similar to this below.
I need to run a query like below and thougth the best way would be to pass along a variable as the parameter. This way RDL will not prompt user when it's run.
SQL Query:
Declare @PayDate as datetime
select top 1 @paydate = editdate
from vs_paycateditimport
order by convert(datetime,editdate) desc
select
oe.paygroup,vsp.paycat,sum(convert(float,[amount])) as Dollars
from vs_paycateditimport vsp inner join ol_employee2 oe on oe.employeenumber = vsp.empid
where convert(datetime,Editdate) = @paydate
and vsp.paycat in (733,734)
group by oe.paygroup,vsp.paycat
Is this possible and how do I do this?
The reason for this is I actually have a SQL Select statement that will be running to get results. The sql query uses a paramter when it's run. The parameter will be a value based on anohter query. Similar to this below.
I need to run a query like below and thougth the best way would be to pass along a variable as the parameter. This way RDL will not prompt user when it's run.
SQL Query:
Declare @PayDate as datetime
select top 1 @paydate = editdate
from vs_paycateditimport
order by convert(datetime,editdate) desc
select
oe.paygroup,vsp.paycat,sum(convert(float,[amount])) as Dollars
from vs_paycateditimport vsp inner join ol_employee2 oe on oe.employeenumber = vsp.empid
where convert(datetime,Editdate) = @paydate
and vsp.paycat in (733,734)
group by oe.paygroup,vsp.paycat