View Single Post
  #2  
Old May 24th, 2010, 01:17 PM posted to microsoft.public.access
Douglas J. Steele[_3_]
external usenet poster
 
Posts: 3,143
Default can someone tell me where my formula going wrong V2

I suspect the problem is due to precedence of Or vs And.

Try using IN

=DSum("[Amount6a6fs]","[Sales Analysis]","[Posting Date Period] = '" &
[cbMonth] & "' And [Revenue Stream Division] IN ('Production', 'other')
And ([Customer No] = 'C01317')")

or put parentheses around the OR

=DSum("[Amount6a6fs]","[Sales Analysis]","[Posting Date Period] = '" &
[cbMonth] & "' And ([Revenue Stream Division] = 'Production' or [Revenue
Stream Division] = 'other') And ([Customer No] = 'C01317')")

--
Doug Steele, Microsoft Access MVP
http://www.AccessMVP.com/djsteele
Co-author: Access 2010 Solutions, published by Wiley
(no e-mails, please!)



"Alan" wrote in message
...
=DSum("[Amount6a6fs]","[Sales Analysis]","[Posting Date Period] = '" &
[cbMonth] & "' And [Revenue Stream Division] = 'Production' or [Revenue
Stream Division] = 'other' And ([Customer No] = 'C01317')")

every works apart from the last par customer no, the table name is correct
spelling,
the sun i'm getting is for everything not that specifc customer.