Daily Occurrance Report

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

Guest

I have a query qryDailyDressCodeCount that I pull a daily count of all dress
code violations. The query uses a form with 2 combo boxes to select a range
of dates to include on the report. No problem.

What I don't need is Access including weekend dates in the report when they
are not in the query. The violations will only occurr during weekdays. How
do I get Access to stop helping me by including the weekend dates. They are
always zero and do not need to be in the report.

Frustrated Rip!
 
Without some information regarding your tables/fields and possibly sample
records, I can only suggest "Correction Tape" and/or "white out".
 
Info comes from query DailyDressCodeCount from a table that is linked to a
table tblDcViolations.

The query pulls records from the table using a start date and end date that
are user selected from a form, so the number of dates is variable.

The dates are in mm/dd/yyyy format. There will be NO weekend dates at all
as violations will only occur during the week.

The query counts the number of violations on a given date and returns that
number and the date on which they occurred.

The fields in the final query are Date and CountOfDate.

I use the Chart Wizard to create the graph. It is a simple bar graph with
dates on the X axis and CountOfDate on the Y axis. I just don't want those
weekend dates to be included. Let me know what other information you need.

--
Thanks As Always
Rip


Duane Hookom said:
Without some information regarding your tables/fields and possibly sample
records, I can only suggest "Correction Tape" and/or "white out".
 
Ripper,

In the final query that creates the dataset for your report, in the criteria
row for your date field put weekday(MyDate,vbMonday) < 6

This will exclude weekends.

Ripper said:
Info comes from query DailyDressCodeCount from a table that is linked to a
table tblDcViolations.

The query pulls records from the table using a start date and end date that
are user selected from a form, so the number of dates is variable.

The dates are in mm/dd/yyyy format. There will be NO weekend dates at all
as violations will only occur during the week.

The query counts the number of violations on a given date and returns that
number and the date on which they occurred.

The fields in the final query are Date and CountOfDate.

I use the Chart Wizard to create the graph. It is a simple bar graph with
dates on the X axis and CountOfDate on the Y axis. I just don't want those
weekend dates to be included. Let me know what other information you need.
 
I keep getting the "That expression is typed incorrectly or too complex or to
be evaluated" error. When I enter the expression Access puts "around MyDate
and vbMonday.

Any tips?
 
Okay, to be more specific,

If you are using a combo box to select the date, then you will need to
reference that combo box. Also, the value of the constant vbMonday is 2, you
can use that instead, so try:

=Weekday(forms![MyForm]![cboDateToCompare],2)

The other problem you may encounter is data type matching. If the field in
your query is a date data type and the value in your combo is a date data
type, then there is no problem, otherwise, you will have to do whatever type
conversions necessary to make it work.
 
Back
Top