Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Field Not Calculating in Report

Status
Not open for further replies.

mcongdon

Programmer
Mar 14, 2008
98
US
I have a query that has around 30 fields in it, all of them calculations from other smaller queries. I created the large one so that there was one query to base a report off of rather than using subreports. When I try and use a text box in the report with the control source as:
Code:
=[CDConcessionBuy]+[CDConcessionSell]
There is no value returned. CDConcessionBuy should return 2153, CDConcessionSell should return 0 for a total of 2153. When I put the control source as being just CDConcessionBuy, i get the correct answer. I think this problem is because the query that is supposed to be returning 0 is returning a null (not the same as I have learned through these forums ;-)). Unfortunately, I dont know how to fix it. Here's the query it is pulling from:
Code:
SELECT Sum([Execution Price]) AS CDExecutionSell, Sum([Street Price]) AS CDStreetSell, Sum([Quantity]) AS CDQuantitySell, Sum(([Street Price]-[Execution Price])*[Quantity]*10) AS CDConcessionSell, Count([Execution Price]) AS CDTicketCountSell
FROM tbl_BLOTTER
WHERE ((([tbl_BLOTTER].[Type])="CD") And (([tbl_BLOTTER].[Trade Date])=[Forms]![frm_DAILYBLOTDATE]![cboStartDate]) And (([tbl_BLOTTER].[Firm])=0) And (([tbl_BLOTTER].[Buy/Sell])="Sell"));

Once again, I would like to have CDConcessionSell return a 0 instead of null if there is nothing to sum.
Thanks for your help!
 
I figured it out. I used the nz function on the report itself rather than doing anything to the query. Sorry to post this so early in my attempts
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top