DCount?

B

bw

My SQL Code is as follows:

SELECT tblBillSeats.BankName, tblBillSeats.BPseats, tblBillSeats.Pamt,
tblBillSeats.BTseats, tblBillSeats.Tamt, tblBillSeats.BType
FROM tblBanks INNER JOIN tblBillSeats ON tblBanks.BankName =
tblBillSeats.BankName
GROUP BY tblBillSeats.BankName, tblBillSeats.BPseats, tblBillSeats.Pamt,
tblBillSeats.BTseats, tblBillSeats.Tamt, tblBillSeats.BType;

1. I want to know how many values of BType are True, and how many are
False for each BankName.

2. I want to know how many BTypes there are for each BankName.

While I'm sure DCount is what to use here, I can't get anything to work.

This is giving me a syntax error:

CountTrue: DCount("[BillSeatsID]","[tblBillSeats]","[BType] = True and
[tblBillSeats]![BankName] = " & [tblBillSeats]![BankName])
 
K

Ken Snell \(MVP\)

Assuming that BankName field is a text field:

CountTrue: DCount("*","[tblBillSeats]","[BType] = True and
[BankName] = '" & [BankName] & "'")
 
B

bw

Thank you sir!
I also learned something new from your use of the asterisk.


Ken Snell (MVP) said:
Assuming that BankName field is a text field:

CountTrue: DCount("*","[tblBillSeats]","[BType] = True and
[BankName] = '" & [BankName] & "'")


--

Ken Snell
<MS ACCESS MVP>


bw said:
My SQL Code is as follows:

SELECT tblBillSeats.BankName, tblBillSeats.BPseats, tblBillSeats.Pamt,
tblBillSeats.BTseats, tblBillSeats.Tamt, tblBillSeats.BType
FROM tblBanks INNER JOIN tblBillSeats ON tblBanks.BankName =
tblBillSeats.BankName
GROUP BY tblBillSeats.BankName, tblBillSeats.BPseats, tblBillSeats.Pamt,
tblBillSeats.BTseats, tblBillSeats.Tamt, tblBillSeats.BType;

1. I want to know how many values of BType are True, and how many are
False for each BankName.

2. I want to know how many BTypes there are for each BankName.

While I'm sure DCount is what to use here, I can't get anything to work.

This is giving me a syntax error:

CountTrue: DCount("[BillSeatsID]","[tblBillSeats]","[BType] = True and
[tblBillSeats]![BankName] = " & [tblBillSeats]![BankName])
 

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


Top