Query Formula need HELP

K

Kaylen

In my query I have been using this formula to count the # of files reviewed:

Number of Files Reviewed: DCount("*","Files","[Review Date] and [Review
Date]=#" & [Confirm Review Date] & "#")

Now I would like to add another condition to the formula. I want the formula
to count the number of files when field [1]= whatever the user type in. That
is two condition total. Count when the review date = whatever the user types
in AND when [1]= whatever the user types. Please help.
 
M

Michel Walsh

Number of Files Reviewed: DCount("*","Files","[Review Date] and [Review
Date]=#" & [Confirm Review Date] & "# AND [1] = """ & [whatever you want
to type] & """" )



where I assumed the field name [1] data type is string data and the
whatever is typed does NOT contain any " .


Vanderghast, Access MVP
 
K

Kaylen

This is what I came up with using your formula:

Number of Files Reviewed: DCount("*","Files","[Review Date] and [Review
Date]=#" & [Confirm Review Date] & "#†AND [1] = """ & [Enter Service Type]
& """")

But I get an error message saying that "Syntax error(missing operator) in
query expression '[Review Date] and [Review Date]=#08/08/08" and [1]=#PN#

Michel Walsh said:
Number of Files Reviewed: DCount("*","Files","[Review Date] and [Review
Date]=#" & [Confirm Review Date] & "# AND [1] = """ & [whatever you want
to type] & """" )



where I assumed the field name [1] data type is string data and the
whatever is typed does NOT contain any " .


Vanderghast, Access MVP


Kaylen said:
In my query I have been using this formula to count the # of files
reviewed:

Number of Files Reviewed: DCount("*","Files","[Review Date] and [Review
Date]=#" & [Confirm Review Date] & "#")

Now I would like to add another condition to the formula. I want the
formula
to count the number of files when field [1]= whatever the user type in.
That
is two condition total. Count when the review date = whatever the user
types
in AND when [1]= whatever the user types. Please help.
 
M

Michel Walsh

Remove the " after the second #


It seems also useless to have the first: [Review Date] and

so, try:

DCount("*","Files","[Review Date]=#" & [Confirm Review Date] & "# AND [1] =
""" & [Enter Service Type] & """")



Vanderghast, Access MVP


Kaylen said:
This is what I came up with using your formula:

Number of Files Reviewed: DCount("*","Files","[Review Date] and [Review
Date]=#" & [Confirm Review Date] & "#" AND [1] = """ & [Enter Service
Type]
& """")

But I get an error message saying that "Syntax error(missing operator) in
query expression '[Review Date] and [Review Date]=#08/08/08" and [1]=#PN#

Michel Walsh said:
Number of Files Reviewed: DCount("*","Files","[Review Date] and [Review
Date]=#" & [Confirm Review Date] & "# AND [1] = """ & [whatever you
want
to type] & """" )



where I assumed the field name [1] data type is string data and the
whatever is typed does NOT contain any " .


Vanderghast, Access MVP


Kaylen said:
In my query I have been using this formula to count the # of files
reviewed:

Number of Files Reviewed: DCount("*","Files","[Review Date] and [Review
Date]=#" & [Confirm Review Date] & "#")

Now I would like to add another condition to the formula. I want the
formula
to count the number of files when field [1]= whatever the user type in.
That
is two condition total. Count when the review date = whatever the user
types
in AND when [1]= whatever the user types. Please help.
 

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

Top