Quote:
Originally Posted by plaguna
Actually I want to retrieve [Status ]=“Sold not Set” when [Sold Date] is >=11/01/2008.
I found that Count will count all non-null values. That’s why I didn’t get the right data.
What do you think about this expression.
Code:
- Abs(Sum([BDC Info Table].[Status]="Sold Not Set" And [BDC Info Table].[Sold Date]<#11/1/2008#)) AS [CountOfSold Not Set]
plaguna
Does your expression work for you? Also, in regards to your statement count not including null values, you should be aware that Count(*) counts null and non-null values. Count([SomeField]) will only count non-null values.
If your expression above does not work, you can try this variation of the one I gave you previously that utilizes the null to zero function, which should convert your nulls to zeros in the count and give you the answer you are looking for.
-
nz(Count(IIf([BDC Info Table].[Status]="Sold Not Set",0)),0) + nz(Count(IIf([BDC Info Table].[Sold Date]>=#11/1/2008#,0))),0) AS [CountOfSold Not Set]