It works just fine for customers with values for Ret, but fur customers with
no returns, nothign shows up in Net Sales. I've tried an IIf statement to
see if I can get it to carry the subtotal down for those customers but still
nothing. I'm new to access and probably stuck in spreadsheet think, but I
need net Sales to have a value, because I plan on using that value later in
calculations and I want it to show up on my report also.
Thanks
You probably need something like the following as the control's source expression.
=Sum(Amount)-NZ(Sum(Returns),0)
John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
You'll need to double-click on the line between the two tables in the query
and select the second option when the dialog box appears. You need a left
join so that records will still show up when there isn't a ret.
The first option is an inner join which means both tables must have a
matching record for any record to be returned.
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.
--
Build a little, test a little.
If the Ret is a null, then subtracting it from the Subtotal will produce a
null.
Try surrounding the Ret field with the NZ function. If it's a Null value,
you can use NZ to change it to 0. It would look something like below.
NZ([Ret],0)
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.