ste4en
Technical User
- Aug 1, 2001
- 69
The results of a cross tab query are shown below. I need to filter these results in a report and am trying the code beneath. I only want to see the rows where an employee's time is greater than 8 hours on any day AND when it is charged to code 3101. In the example below it should return 2 rows - for larry and mikeS. My filter is returning all records. Is my filter correct, how else should I be doing this. Thanks
Code Name Total MondayHRS TuesdayHRS WednesdayHRS ThursdayHRS FridayHRS
2001 John 28.5 8 10 8.5
2201 mike 22.5 8 8 8
2601 mark 48 8 8 8
3001 dean 28.5 8 8 8.5
3101 larry 30 8 8 10
3101 mikeS 29.5 8 10 9.5
3301 julian 29.25 9.75 8 8
3401 javier 28.5 8 10 8
3501 Mick 29 8 8 8
3601 dan 30 8 8 8
3901 sam 30 8 8 8
4101 tony 37 8 8 8
4201 todd 20 8 10 8
Code Name Total MondayHRS TuesdayHRS WednesdayHRS ThursdayHRS FridayHRS
2001 John 28.5 8 10 8.5
2201 mike 22.5 8 8 8
2601 mark 48 8 8 8
3001 dean 28.5 8 8 8.5
3101 larry 30 8 8 10
3101 mikeS 29.5 8 10 9.5
3301 julian 29.25 9.75 8 8
3401 javier 28.5 8 10 8
3501 Mick 29 8 8 8
3601 dan 30 8 8 8
3901 sam 30 8 8 8
4101 tony 37 8 8 8
4201 todd 20 8 10 8
Code:
strWhere is String
strDocName is String
strWhere: Code= "3101" And MondayHRS > 8_
Or Code= "3101" And TuesdayHRS > 8_
Or Code= "3101" And WednesdayHRS > 8_
Or Code= "3101" And ThursdayHRS > 8_
Or Code= "3101" And FridayHRS > 8_
strDocName = “rptExeededHours”
DoCmd.OpenReport stDocName, acPreview, , strWhere