Solved

Trying to count records that meet certain criteria in query designer

Posted on 2013-11-25
4
378 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 48

Expert Comment

by:Dale Fye
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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

615 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