[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Add Command - SQL query as Data Source for Report

Posted on 2008-10-06
5
Medium Priority
?
670 Views
Last Modified: 2010-04-21
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
0
Comment
Question by:JMO9966
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 101

Assisted Solution

by:mlmcc
mlmcc earned 1000 total points
ID: 22655083
2 ways, that I can think of.

Add the command without using the where clause.
When you add the command you can add a parameter to it.,
Then add the where clause using the parameter.

The other way would be to just add it as a command without the where clause then add a report parameter and use the select expertwith the parameter to filter the data.

mlmcc
0
 

Author Comment

by:JMO9966
ID: 22655156
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"

0
 
LVL 101

Assisted Solution

by:mlmcc
mlmcc earned 1000 total points
ID: 22655437
After you add the parameter you have to add it to the query.

How are you adding it?

mlmcc
0
 
LVL 19

Accepted Solution

by:
GJParker earned 1000 total points
ID: 22661032
I wouldn't use a command at all, create your subreport using tables and a normal paramter and then CR to sum the invoice_detail.amount

HTH
0
 

Author Closing Comment

by:JMO9966
ID: 31503646
Thanks guys!
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question