My DCount function isn't working.....

J

J. Keggerlord

=DCount("[ToolID]","tblTools","[LoadDue] >= [DateNow] AND [LoadAct] IsNull")

ToolID is a field in my table that is an autonumber (hence, always
populated), tblTools is the table in which ToolID, LoadDue, and LoadAct
reside. DateNow is field on my actual report. For some reason, my syntax is
giving me an error. I also tried using a Count-Iif statement, which gave me
an error, too. There is no record source to which the report is tied. Any
thoughts? You can start your response with the words "Well, idiot...." and
I'll not be offended. ;)
 
O

Ofer Cohen

Try

=DCount("*","tblTools","[LoadDue] >= #" & [DateNow] & "# AND [LoadAct]
IsNull")

Taking the [DateNow] outside
 
D

Duane Hookom

I think IsNull needs to be changed:
=DCount("*","tblTools","[LoadDue] >= #" & [DateNow] & "# AND [LoadAct] Is
Null")
or
=DCount("*","tblTools","[LoadDue] >= #" & [DateNow] & "# AND
IsNull([LoadAct])")
--
Duane Hookom
Microsoft Access MVP


Ofer Cohen said:
Try

=DCount("*","tblTools","[LoadDue] >= #" & [DateNow] & "# AND [LoadAct]
IsNull")

Taking the [DateNow] outside

--
Good Luck
BS"D


J. Keggerlord said:
=DCount("[ToolID]","tblTools","[LoadDue] >= [DateNow] AND [LoadAct] IsNull")

ToolID is a field in my table that is an autonumber (hence, always
populated), tblTools is the table in which ToolID, LoadDue, and LoadAct
reside. DateNow is field on my actual report. For some reason, my syntax is
giving me an error. I also tried using a Count-Iif statement, which gave me
an error, too. There is no record source to which the report is tied. Any
thoughts? You can start your response with the words "Well, idiot...." and
I'll not be offended. ;)
 
J

J. Keggerlord

Thank you, Duane and Ofer! Your suggestions did the trick!


Duane Hookom said:
I think IsNull needs to be changed:
=DCount("*","tblTools","[LoadDue] >= #" & [DateNow] & "# AND [LoadAct] Is
Null")
or
=DCount("*","tblTools","[LoadDue] >= #" & [DateNow] & "# AND
IsNull([LoadAct])")
--
Duane Hookom
Microsoft Access MVP


Ofer Cohen said:
Try

=DCount("*","tblTools","[LoadDue] >= #" & [DateNow] & "# AND [LoadAct]
IsNull")

Taking the [DateNow] outside

--
Good Luck
BS"D


J. Keggerlord said:
=DCount("[ToolID]","tblTools","[LoadDue] >= [DateNow] AND [LoadAct] IsNull")

ToolID is a field in my table that is an autonumber (hence, always
populated), tblTools is the table in which ToolID, LoadDue, and LoadAct
reside. DateNow is field on my actual report. For some reason, my syntax is
giving me an error. I also tried using a Count-Iif statement, which gave me
an error, too. There is no record source to which the report is tied. Any
thoughts? You can start your response with the words "Well, idiot...." and
I'll not be offended. ;)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top