Solved

Trying to count records that meet certain criteria in query designer

Posted on 2013-11-25
4
344 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 119

Expert Comment

by:Rey Obrero
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

Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…

920 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now