Trouble with control source statements

kblehman

Registered User.
Local time
Yesterday, 19:41
Joined
May 11, 2007
Messages
22
I have a summary report that is based on the primary data table. The report contains a number of fields that are filtered by a statement in their control source. I now need to add a second filter criteria to each statement, but I'm having trouble getting the correct results.

Each statement below needs to not only filter on the existing date criteria, it also needs to find records where NotifType=9.

STMT #1:
=Sum(Abs(Year([RecDate])=Year(Date())))

I changed it to this:
=Sum((Abs(Year([RecDate])=Year(Date()))) And ([NotifType]=9))

The correct result = 32, but the report shows -32. I assume I'm getting a negative number because of my parenthesis and have tried moving them around, but no luck.



These 2 statements also need to find records in the date range AND where NotifType=9.

STMT #2:
=Sum(Abs([RecDate] Between [Forms]![frmRptCriteria]![txtBeginDate] And [Forms]![frmRptCriteria]![txtEndDate]))


STMT #3:
=Sum(Abs([RecDate] Between ([Forms]![frmRptCriteria]![txtBeginDate]-365) And ([Forms]![frmRptCriteria]![txtEndDate]-365)))


Any help one of you code wizards can provide will be greatly appreciated.
 
if
=Sum(Abs(Year([RecDate])=Year(Date())))
gives you -32 wouldnt
=Sum(Abs(Year(Date())=Year([RecDate])))
give you 32???
 
I got it. Here's what worked:
=Sum(Abs(Year([RecDate])=Year(Date()) And ([NotifType]=9)))
 

Users who are viewing this thread

Back
Top Bottom