include query results in a report

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want to inlcude the results of a query in a report.

Basically:
SELECT SUM(numberOfHours)
FROM myTable
WHERE myVersion =[myDropDown], myPlatform = 'Server';

My report is filtered on myVersion value which is selected in a dropdown.
But, I can not find any way to display the results of this query on the Report.

I was able to get the overall sum of numberOfHours but I am struggling trying to
come up with a way to split it into my three platform groups.

The overall sum I had to use textboxes and the sum property to get it to work.
It would be much easier if I could just display the results of a query.
 
AndyS said:
I want to inlcude the results of a query in a report.

Basically:
SELECT SUM(numberOfHours)
FROM myTable
WHERE myVersion =[myDropDown], myPlatform = 'Server';

My report is filtered on myVersion value which is selected in a dropdown.
But, I can not find any way to display the results of this query on the Report.

I was able to get the overall sum of numberOfHours but I am struggling trying to
come up with a way to split it into my three platform groups.

The overall sum I had to use textboxes and the sum property to get it to work.
It would be much easier if I could just display the results of a query.


The separate conditions in a Where clause have to be
separated by AND or OR. Mot sure, but I think you want to
use:

WHERE myVersion=[myDropDown] And myPlatform = 'Server'

You can use a Domain Aggregate function (equivalent to your
query) in a text box to get the desired total:

=DSum("numberOfHours", "myTable", "myVersion=[myDropDown]
And myPlatform = 'Server' ")

I didn't follow the other part of your question, but I think
you just need to add additional conditions to the Where part
of the DSum.
 
My main problem was the fact that on an access report , the textbox is very limited in what can be put in it. I will try using dsum in the control source and see if it works. If it does then my problem is solved. If it does not then I need to figure out some other way of displaying totals broken down into categories on my access reports. Thanks for the help, I will try this out on Monday since I don't get paid ont he weekend. :p

Marshall Barton said:
AndyS said:
I want to inlcude the results of a query in a report.

Basically:
SELECT SUM(numberOfHours)
FROM myTable
WHERE myVersion =[myDropDown], myPlatform = 'Server';

My report is filtered on myVersion value which is selected in a dropdown.
But, I can not find any way to display the results of this query on the Report.

I was able to get the overall sum of numberOfHours but I am struggling trying to
come up with a way to split it into my three platform groups.

The overall sum I had to use textboxes and the sum property to get it to work.
It would be much easier if I could just display the results of a query.


The separate conditions in a Where clause have to be
separated by AND or OR. Mot sure, but I think you want to
use:

WHERE myVersion=[myDropDown] And myPlatform = 'Server'

You can use a Domain Aggregate function (equivalent to your
query) in a text box to get the desired total:

=DSum("numberOfHours", "myTable", "myVersion=[myDropDown]
And myPlatform = 'Server' ")

I didn't follow the other part of your question, but I think
you just need to add additional conditions to the Where part
of the DSum.
 
AndyS said:
My main problem was the fact that on an access report , the textbox is very limited in what can be put in it. I will try using dsum in the control source and see if it works. If it does then my problem is solved. If it does not then I need to figure out some other way of displaying totals broken down into categories on my access reports.

The "normal" way to display totals by "category" is to group
the report data on the category field and use a text box in
the group footer with an expression like =Sum(amountfield)

If you want a summary at the end of the report, create a
simple report based on a Totals type query and use that as a
subreport in the report's footer.
--
Marsh
MVP [MS Access]


AndyS said:
I want to inlcude the results of a query in a report.

Basically:
SELECT SUM(numberOfHours)
FROM myTable
WHERE myVersion =[myDropDown], myPlatform = 'Server';

My report is filtered on myVersion value which is selected in a dropdown.
But, I can not find any way to display the results of this query on the Report.

I was able to get the overall sum of numberOfHours but I am struggling trying to
come up with a way to split it into my three platform groups.

The overall sum I had to use textboxes and the sum property to get it to work.
It would be much easier if I could just display the results of a query.
Marshall Barton said:
The separate conditions in a Where clause have to be
separated by AND or OR. Mot sure, but I think you want to
use:

WHERE myVersion=[myDropDown] And myPlatform = 'Server'

You can use a Domain Aggregate function (equivalent to your
query) in a text box to get the desired total:

=DSum("numberOfHours", "myTable", "myVersion=[myDropDown]
And myPlatform = 'Server' ")

I didn't follow the other part of your question, but I think
you just need to add additional conditions to the Where part
of the DSum.
 
Back
Top