PC Review


Reply
Thread Tools Rate Thread

DCount Rookie Question

 
 
=?Utf-8?B?a25vd3Nob3dyb3NlZ3Jvd3M=?=
Guest
Posts: n/a
 
      28th Mar 2007
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.
--
Thanks
 
Reply With Quote
 
 
 
 
Rick Brandt
Guest
Posts: n/a
 
      28th Mar 2007
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



 
Reply With Quote
 
=?Utf-8?B?a25vd3Nob3dyb3NlZ3Jvd3M=?=
Guest
Posts: n/a
 
      28th Mar 2007
Aha! Another light comes on. That SQL worked perfectly.
--
Thanks


"Rick Brandt" wrote:

> 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
>
>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
rookie question Nevermind Microsoft Excel Charting 2 12th Jun 2007 05:57 PM
Access 2003 DCount Syntax Rookie =?Utf-8?B?a25vd3Nob3dyb3NlZ3Jvd3M=?= Microsoft Access Queries 4 28th Mar 2007 08:32 PM
Rookie Question - I need help!! Daniel Printers 1 28th Sep 2004 11:42 PM
Rookie Question Big E Microsoft ASP .NET 2 17th Jun 2004 06:27 AM
rookie question Dave B Microsoft Powerpoint 1 21st Jan 2004 01:24 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:14 AM.