knowshowrosegrows wrote:
> I am self-taught on this software and just beginning to understand
> syntax.
>
> I am trying to do what seems to be a simple DCOUNT and I don't have it
> right. I want to count the times in a specific date range that the
> records in the Denial Specific Info Table has the First Level Appeal
> Determination Field register "Denied."
>
> My most recent attempt didnt even include the date range question and
> it is not working
> Expr1: DCount("[RecordID]","[Denial Specific Info]","[First Level
> Appeal
>> Determinations]='Denied'").
>
> Now, my Denial Specific Info table has three test records. One =
> "Denied" and Two = "Granted." When I run the query with the syntax I
> have I get
> a table with one field titled Expr1. In that field there are three
> rows with a "1" in each row. So it did count the number of "Denied"
> I have but it repeated it for the same number of records in the
> original table.
Normally one would not use DCount() in a query except in very special
circumstances. It would typically be used in a form or report or in code to
return a count from "some other query or table".
In a query you just show the Totals row in the query designer by using
"Show - Totals" from the menu and then use Count in the grid as the Totals
option. The SQL of such a query would be...
SELECT Count(*)
FROM [Denial Specific Info]
WHERE [First Level Appeal] = "Denied"
AND DateFieldName >= #2007-01-01#
AND DateFieldName < #2007-03-28#
--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com
|