Ok. Lets try this and see if it gets you closer to what you are looking for.
Rather than using NZ, this uses IIF( ) and IsNull() functions to count (SUM
actually) the number of Null zip codes
SELECT qryAll.StoreNumber,
qryAll.StoreName,
Count(qryAll.Zips) AS CountOfZips,
Sum(IIF(ISNULL(qryAll.Zips), 1, 0)) as Count of NullZips,
qryAll.[Date Open],
DateDiff("d",[Date Open],Date()) AS [Days Open]
FROM qryAll
GROUP BY qryAllDRVP.StoreNumber,
qryAll.StoreName,
qryAll.[Date Open],
DateDiff("d",[Date Open],Date()),;
HTH
Dale
--
Email address is not valid.
Please reply to newsgroup only.
Octet32 said:
The purpose of the count is to count all active zips if there is a null in
with the zips that means All or if there is a Null that means all, the other
zips i would like two be counted as normal, i will then be pulling this
info into a report.
SELECT, qryAll.StoreNumber, qryAll.StoreName, Count(qryAll.Zips) AS
CountOfZips, qryAll.[Date Open], DateDiff("d",[Date Open],Date()) AS [Days
Open]
FROM qryAll
GROUP BY qryAllDRVP.StoreNumber, qryAll.StoreName, qryAll.[Date Open],
DateDiff("d",[Date Open],Date()),;
:
Then what is the purpose of the Count? What do you want to display if none
of the items are NULL?
Like I asked in my previous post, copy the entire SQL for your query and
post it here. It should help me get a better understanding of what you are
trying to accomplish.
--
Email address is not valid.
Please reply to newsgroup only.
:
I need if one of the values in the Field is NULL then ALL.
Thanks
:
Post your whole query.
It looks like what you want is if all of the values in [Field] are Null,
then, return "All".
Is that what you are looking for?
--
Email address is not valid.
Please reply to newsgroup only.
:
No luck I get a error that says You tried to execute a query that does not
include the specified expression
Count([qrySummary].[Field])=NZ([Field],â€ALLâ€)
Than if I type it like above A parameter query open than it says Expression
is type incorrectly or is to complex
:
Try the NZ( ) function. It converts a Null into a variant with whatever
value you provide. If you don't provide the optional 2nd argument, it
returns a zero, thus the name NZ = Null-to-Zero.
In your case it might look like:
QueryField: NZ([Field], "All")
HTH
Dale
--
Email address is not valid.
Please reply to newsgroup only.
:
,I have a query That counts the number of record if record is NULL i need for
it to display ALL, I tryed the Iff stament below but no luck can anyone help
with this?
IIf([Field] = Is Null,"ALL")
Thanks
Octet