Trying to count records that meet certain criteria in query designer

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
SteveL13Asked:
Who is Participating?
 
mbizupConnect With a Mentor Commented:
CountSold: SUM(ABS(NZ([Sold Date],"")<> ""))

(You don't need a subquery)
0
 
Rey Obrero (Capricorn1)Commented:
CountSold: (Select Count(*) From TableX where [Sold Date] is not Null)
0
 
Surone1Commented:
isdate( [Sold Date]) should work for date fields as well
0
 
Dale FyeCommented:
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
All Courses

From novice to tech pro — start learning today.