Link to home
Start Free TrialLog in
Avatar of JMO9966
JMO9966

asked on

Add Command - SQL query as Data Source for Report

Hello,

I'm using the Add Command for an ODBC data source and building the query as follows:

select sum(Invoice_Detail.Amount) As Revenue
From Invoice_Detail
Inner Join Invoice_Header On Invoice_Detail.Document=Invoice_Header.Document
where Invoice_Detail.Job = 'REVENUE'

What I'd like to do is make the query dynamic and use a formula result that holds a shared variable from the main report instead of the Job value hard-coded above ('REVENUE').

Also, once I add this field onto my report, I can't figure out how to edit the query behind this field ??

Thanks,
JMO9966
SOLUTION
Avatar of Mike McCracken
Mike McCracken

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of JMO9966
JMO9966

ASKER

Thanks again,

I tried adding a parameter to the sql query itself but it error'd when I hit OK.  I set it as a String type.

"To Few parameters, expected 1"

SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of JMO9966

ASKER

Thanks guys!