If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
can someone tell me where my formula going wrong V2
=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. |
#2
|
|||
|
|||
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. |
#3
|
|||
|
|||
can someone tell me where my formula going wrong V2
=?Utf-8?B?QWxhbg==?= wrote in
: =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. Parentheses are messed up. You have unnecessary ones around the ([Customer No] = 'C01317') but more importantly are missing a pair around your two [Revenue Stream Division] = parameters. Try =DSum( "[Amount6a6fs]", "[Sales Analysis]", "[Posting Date Period] = '" & [cbMonth] & "' And ( [Revenue Stream Division] = 'Production' or [Revenue Stream Division] = 'other' ) And [Customer No] = 'C01317'" ) (all on 1 line, i've split it to show the grouping) |
Thread Tools | |
Display Modes | |
|
|