Counting Problem

G

Guest

I've used the following to count the number of records in my table:
DCount("*","Rooms") and it works great to give me a total of all the
barracks rooms we have. Now I need to count the number of rooms that are
empty and full. Easiest way to determine is if the "Last_Name" field is Null
or Not Null. Can anyone help with the formula? I've tried a couple and keep
getting errors.
Thanks!
Dan
 
G

Guest

Use your table name instead of Traver.

SELECT Count(Traver.Rooms) AS [Room Count], (SELECT Count([Rooms]) FROM
Traver WHERE [Last_Name] Is Null) AS Empty, (SELECT Count([Rooms]) FROM
Traver WHERE [Last_Name] Is Not Null) AS [Full]
FROM Traver;
 

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