Dsum multiple criteria (1 Viewer)

irwan.dwise

New member
Local time
Today, 14:06
Joined
Nov 29, 2021
Messages
2
Hello my name Irwan from Indonesia, i have problem with with syntax, i try to make recapitulation of material for each contract, can anyone help, please.
Thanks and sorry if my english not good

Code:
DSum("Qty";"Detail Kontrak";" [Material]='Jointing Coldshrink Resin 300' And  [No Subkontrak]  =" & [Nomor Sub Pemesanan] & " ")

here i attach the screenshot of my databse relation
 

Attachments

  • Picture.JPG
    Picture.JPG
    126.4 KB · Views: 201

Jon

Access World Site Owner
Staff member
Local time
Today, 08:06
Joined
Sep 28, 1999
Messages
7,425
Welcome to the forums! We are the most active Microsoft Access community on the internet by far, with posts going back over 20 years!

To get started, I highly recommend you read the post below. It contains important information for all new users to this forum.

https://www.access-programmers.co.uk/forums/threads/new-member-read-me-first.223250/

We look forward to having you around here, learning stuff and having fun!
 

theDBguy

I’m here to help
Staff member
Local time
Today, 00:06
Joined
Oct 29, 2018
Messages
21,515
Hi. Welcome to AWF!

I'm not sure, but using spaces in your field names could be adding to the problem.
 
Last edited:

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 15:06
Joined
May 7, 2009
Messages
19,246
you have space on your table name/query so enclose it in square bracket:

"[Detail Kontrak]"
 

oleronesoftwares

Passionate Learner
Local time
Today, 00:06
Joined
Sep 22, 2014
Messages
1,159
Any table or field name with double words spaced e.g detail kontrak should have an underscore between them.i.e detail_kontrak. Also @arnelgp suggestion should be applied
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 00:06
Joined
Aug 30, 2003
Messages
36,129
Welcome to AWF. I moved your thread to a more appropriate forum.
 

azhar2006

Registered User.
Local time
Today, 00:06
Joined
Feb 8, 2012
Messages
202
Code:
Expr1: DSum("Qty";"[Detail Kontrak]";"[Material]='Jointing Coldshrink Resin 300' And [No Subkontrak]  =" & [Nomor Sub Pemesanan] & " ")
As he told you (theDBguy) and (arnelgp) you have spaces and also the table name contains an underlined that must be in square brackets
 

Gasman

Enthusiastic Amateur
Local time
Today, 08:06
Joined
Sep 21, 2011
Messages
14,393
Code:
Expr1: DSum("Qty";"[Detail Kontrak]";"[Material]='Jointing Coldshrink Resin 300' And [No Subkontrak]  =" & [Nomor Sub Pemesanan] & " ")
As he told you (theDBguy) and (arnelgp) you have spaces and also the table name contains an underlined that must be in square brackets
Names with underscores do not need to be surrounded by square brackets.?
They are normally there so as not to use square brackets?
 

azhar2006

Registered User.
Local time
Today, 00:06
Joined
Feb 8, 2012
Messages
202
Names with underscores do not need to be surrounded by square brackets.?
They are normally there so as not to use square brackets?
You are correct, I meant that he should not put a ruler (space)
 

Users who are viewing this thread

Top Bottom