Use of the DSUM function

R

RoBo

Who can give me a hand?

I am using the function below; so far so good.
DAvg("[wng_OPP_SLPK1]";"TBL_Woningen";"[wng_CFT Code] = """ & [pdt_CFT code]
& """")

Now I need to generate a sum on a field that contains the value "J". How can
I change the function:
Sum(IIf([TBL_Woningen]![wng_COD_INDCV]="J";1;0))
into a
DSum function where the field to sum is wng_COD_INDCV (with the text "J"),
the table TBL_Woningen and the criteria [wng_CFT Code] = """ & [pdt_CFT code]
& """"

I can not seem to get the syntax right.

Ron
 
D

Duane Hookom

It looks like you actually want to count

DCount("[wng_OPP_SLPK1]";"TBL_Woningen";"[wng_CFT Code] = """ & [pdt_CFT
code] & """ AND wng_COD_INDCV='J'")
 
R

RoBo

Hi Duane,

Thank you very much, this definitely is the solution to my question.

Ron Bouma

Duane Hookom said:
It looks like you actually want to count

DCount("[wng_OPP_SLPK1]";"TBL_Woningen";"[wng_CFT Code] = """ & [pdt_CFT
code] & """ AND wng_COD_INDCV='J'")

--
Duane Hookom
Microsoft Access MVP


RoBo said:
Who can give me a hand?

I am using the function below; so far so good.
DAvg("[wng_OPP_SLPK1]";"TBL_Woningen";"[wng_CFT Code] = """ & [pdt_CFT code]
& """")

Now I need to generate a sum on a field that contains the value "J". How can
I change the function:
Sum(IIf([TBL_Woningen]![wng_COD_INDCV]="J";1;0))
into a
DSum function where the field to sum is wng_COD_INDCV (with the text "J"),
the table TBL_Woningen and the criteria [wng_CFT Code] = """ & [pdt_CFT code]
& """"

I can not seem to get the syntax right.

Ron
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

dsum with multiple criteria and decimals 0
Dsum returns #Error 4
Dsum Problem 3
Dsum Problem with date criteria 1
dsum issue 1
DSUM criteria 3
DSum function 3
Dsum Help 0

Top