date range sum in a report

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

i have a report that has many things going on..however,
i need to know what's wrong with this?

=DCount("[reviewmonth]","databaseqry","[reviewmonth] and [14a]='1' And
[Hospital] = '" & [Hospital] & "' And [auditdate]="Between ' & [Beginning
Date] &' AND '& [End Date]' ")

everything works but the dater range part :(
help, help !!
 
Almost everything is wrong :-(
First we don't know what you are attempting to count and if databaseqry is
the record source of your report.

What type of value is reviewmonth? Your expression seems to suggest it is
true/false.

Can we assume field 14a is text?

You also have an =Between that doesn't make sense. Values are either = or
between.

Can you clarify where this expression is located and if the records to
consider are the same as the report's record source?
 
ok i'll try.....sorry....new to this message board realm.

The formula is one cell on a report showing me the count of the field
[ReviewMonth] for a date range.

The report is not based on the "databaseqry" query,....the report itself is
based on another qry...(which is based on another table that holds all the
'fallouts' for a question) and this qry asks what hospital and what date
range.

so what i want to know is,
when i open the report, i will type in the hospital and the date range that
i want, and it will show me, in that cell, the count for that hospital and
date range.

it works in another report that's based on a query that asks only hospital
and month(i took out the month part for this)....but for this one when i try
to put in the 'between' part, it doesn't work.

so what i'm asking is.....how do i tell it to use the date range when
looking up the answer for this cell? I just can't get it to do the date range
part.
 
Try this expression:

=DCount("[reviewmonth]","databaseqry","[14a]='1' And
[Hospital] = '" & [Hospital] & "' And [auditdate] Between #" & [Beginning
Date] & "# AND #" & [End Date] & "#")

--
Duane Hookom
Microsoft Access MVP


terri said:
ok i'll try.....sorry....new to this message board realm.

The formula is one cell on a report showing me the count of the field
[ReviewMonth] for a date range.

The report is not based on the "databaseqry" query,....the report itself is
based on another qry...(which is based on another table that holds all the
'fallouts' for a question) and this qry asks what hospital and what date
range.

so what i want to know is,
when i open the report, i will type in the hospital and the date range that
i want, and it will show me, in that cell, the count for that hospital and
date range.

it works in another report that's based on a query that asks only hospital
and month(i took out the month part for this)....but for this one when i try
to put in the 'between' part, it doesn't work.

so what i'm asking is.....how do i tell it to use the date range when
looking up the answer for this cell? I just can't get it to do the date range
part.
--
terri


terri said:
i have a report that has many things going on..however,
i need to know what's wrong with this?

=DCount("[reviewmonth]","databaseqry","[reviewmonth] and [14a]='1' And
[Hospital] = '" & [Hospital] & "' And [auditdate]="Between ' & [Beginning
Date] &' AND '& [End Date]' ")

everything works but the dater range part :(
help, help !!
 
yes! you are wonderful!!! never thought of using the # signs......whew !!
thank you sooooo much :)
--
terri


Duane Hookom said:
Try this expression:

=DCount("[reviewmonth]","databaseqry","[14a]='1' And
[Hospital] = '" & [Hospital] & "' And [auditdate] Between #" & [Beginning
Date] & "# AND #" & [End Date] & "#")

--
Duane Hookom
Microsoft Access MVP


terri said:
ok i'll try.....sorry....new to this message board realm.

The formula is one cell on a report showing me the count of the field
[ReviewMonth] for a date range.

The report is not based on the "databaseqry" query,....the report itself is
based on another qry...(which is based on another table that holds all the
'fallouts' for a question) and this qry asks what hospital and what date
range.

so what i want to know is,
when i open the report, i will type in the hospital and the date range that
i want, and it will show me, in that cell, the count for that hospital and
date range.

it works in another report that's based on a query that asks only hospital
and month(i took out the month part for this)....but for this one when i try
to put in the 'between' part, it doesn't work.

so what i'm asking is.....how do i tell it to use the date range when
looking up the answer for this cell? I just can't get it to do the date range
part.
--
terri


terri said:
i have a report that has many things going on..however,
i need to know what's wrong with this?

=DCount("[reviewmonth]","databaseqry","[reviewmonth] and [14a]='1' And
[Hospital] = '" & [Hospital] & "' And [auditdate]="Between ' & [Beginning
Date] &' AND '& [End Date]' ")

everything works but the dater range part :(
help, help !!
 
Back
Top