Solved

Trying to count records that meet certain criteria in query designer

Posted on 2013-11-25
4
353 Views
Last Modified: 2013-11-25
I'm trying to count records where a field named [Sold Date] is not blank.

Here's my code I have in "Field" in the query designer but it isn't working...

CountSold: =(Count [ID] where [Sold Date]<>"*")

????

--Steve
0
Comment
Question by:SteveL13
4 Comments
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 39674603
CountSold: (Select Count(*) From TableX where [Sold Date] is not Null)
0
 
LVL 13

Expert Comment

by:Surone1
ID: 39674689
isdate( [Sold Date]) should work for date fields as well
0
 
LVL 61

Accepted Solution

by:
mbizup earned 500 total points
ID: 39674763
CountSold: SUM(ABS(NZ([Sold Date],"")<> ""))

(You don't need a subquery)
0
 
LVL 47

Expert Comment

by:Dale Fye (Access MVP)
ID: 39674935
if you are putting this in a control source, you would use the DCOUNT( ) domain function, something like:

Control Source: =DCOUNT("*", "yourTable", "[Sold Date] IS NOT NULL")
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question