A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

dsum syntax



 
 
Thread Tools Display Modes
  #1  
Old April 16th, 2010, 01:41 PM posted to microsoft.public.access
Alan
external usenet poster
 
Posts: 459
Default dsum syntax

Please can someone tell me what wrong with my dsum


=dsum("[Amount]", "Sales Analysis", "SalesgroupingField = "Customer No" & "
CbMonth" = Month" & " "Type = "Actual")
  #2  
Old April 16th, 2010, 01:51 PM posted to microsoft.public.access
Douglas J. Steele[_3_]
external usenet poster
 
Posts: 3,143
Default dsum syntax

Assuming CustomerNo and Month are both numeric variables, it should be

=dsum("[Amount]", "Sales Analysis", "SalesgroupingField = " & _
Customer No & " AND CbMonth = " & Month & "AND Type = 'Actual'")

And, actually, Month is a bad choice for a variable, since it's a reserved
word.

Note the single quotes around Actual.

--
Doug Steele, Microsoft Access MVP
http://www.AccessMVP.com/DJSteele
(no e-mails, please!)

"Alan" wrote in message
...
Please can someone tell me what wrong with my dsum


=dsum("[Amount]", "Sales Analysis", "SalesgroupingField = "Customer No" &
"
CbMonth" = Month" & " "Type = "Actual")



  #3  
Old April 16th, 2010, 02:13 PM posted to microsoft.public.access
Al Campagna[_2_]
external usenet poster
 
Posts: 1,462
Default dsum syntax

Alan,
Because the syntax you've given is "off" by quite a bit, it's hard toll
what elements of the DSum are field names or field values... and what
field types might be involved.

We can give you a better answer if you describe each of the elements
in the DSum, as to whether they are field names, or a possible field values.
If a field name, please indicate the type (Text? Numeric?)

example.. We know [Amount] is a field name and probably numeric type,
and
we're assuming "Sales Analysis" is a table...
Please continue describing all the elements. It will affect the final
syntax.
--
hth
Al Campagna
Microsoft Access MVP 2007-2009
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."

"Alan" wrote in message
...
Please can someone tell me what wrong with my dsum


=dsum("[Amount]", "Sales Analysis", "SalesgroupingField = "Customer No" &
"
CbMonth" = Month" & " "Type = "Actual")



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:15 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.