Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8372

How do I include an SQL query in my document and map it properly to my table?

$
0
0

I have created a custom SQL query for use in a report. Ideally the query would be run when the user generates the report.

 

Here is the query:

 

SELECT AVG(DATEDIFF(d,"OPENDATE","CLSDDATE")*1.0) AS AvgCompletionDaysHighFromLastFullMonth

FROM "maindb"."tidb"."TASKS"

WHERE "PRIORITY" = 'High - 1 Day'

AND DATEPART(m,"CLSDDATE") = DATEPART(m, {?reportingDate})

AND DATEPART(yyyy,"CLSDDATE") = DATEPART(yyyy, {?reportingDate})

 

I added it as a command using Database Expert -> Available data sources -> add command. I didn't link it properly, as there is no corresponding query in in the main TASKS table. Now when adding it to TrackIT, I get an error telling me to map it to the Trackit User DSN: Error opening Track-It! reports: "The report do... | BMC Communities

 

How do I do this? I just want the number that should come from that query to appear in my report.


Viewing all articles
Browse latest Browse all 8372

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>