Solved

IIF Grouping within a Report

Posted on 2013-11-03
4
372 Views
Last Modified: 2013-11-03
Experts,

Can I modfiy the below with an extra criteria?
ie I need to add an additional grouping of:
IIF([tblStatus.Status] Like "*Lost*","Lost"

MyGroup: IIf([tblStatus.Status] Like "*Awarded*" Or [tblStatus.Status] Like "Won*" Or IsNull([ContractAward])=False,"Awarded - within last 30 days",GetGroup([Projects.BidCloseDate],[Projects.ATTApprvDate],[Projects.ATCApprvDate],[Projects.ATSApprvDate],[Projects.ContractAward],[Projects.CorpATTDate],[Projects.ExpectedContractAward]))


thank you
0
Comment
Question by:pdvsa
  • 3
4 Comments
 

Author Comment

by:pdvsa
ID: 39620027
below is the GetGroup function:
Maybe it would be easier to modify within this GetGroup function i/o in the IIF grouping in the report as from above.

Public Function GetGroup(ParamArray dt() As Variant) As String
   
    Dim isPassed As Boolean, isApproaching As Boolean, isGreaterThan30 As Boolean
    Dim i As Byte
   
       For i = 0 To UBound(dt)
        Select Case DateDiff("d", Date, dt(i))
            Case Is > 30
                isGreaterThan30 = True 'Greater than 30 days away
            Case Is >= 0
                isApproaching = True  'within 30 days
            Case Is < 0
                isPassed = True       'in the past
        End Select
    Next
    If (isPassed + isApproaching + isGreaterThan30) = 0 Then
        GetGroup = "Other Tests Not Met"
    Else
        GetGroup = Switch(isApproaching, "Approaching - ATT/ATS/Award (w/in 30 days)", isGreaterThan30, "Greater Than 30 Days Away", isPassed, "Award Pending - ATT & all other dates are in Past ")
    End If
End Function
0
 
LVL 119

Accepted Solution

by:
Rey Obrero earned 500 total points
ID: 39620114
test this


MyGroup: IIf([tblStatus.Status] Like "*Awarded*" Or [tblStatus.Status] Like "Won*" Or IsNull([ContractAward])=False,"Awarded - within last 30 days",IIF([tblStatus.Status] Like "*Lost*","Lost",
GetGroup([Projects.BidCloseDate],[Projects.ATTApprvDate],[Projects.ATCApprvDate],[Projects.ATSApprvDate],[Projects.ContractAward],[Projects.CorpATTDate],[Projects.ExpectedContractAward])))
0
 

Author Comment

by:pdvsa
ID: 39620183
Hi Capricorn, thank you.  I will test after awhile as not at computer at moment.
0
 

Author Closing Comment

by:pdvsa
ID: 39620681
perfect!  Thank you.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In the article entitled Working with Objects – Part 1 (http://www.experts-exchange.com/Microsoft/Development/MS_Access/A_4942-Working-with-Objects-Part-1.html), you learned the basics of working with objects, properties, methods, and events. In Work…
Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

896 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now