Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

IIF Grouping within a Report

Posted on 2013-11-03
4
375 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 120

Accepted Solution

by:
Rey Obrero (Capricorn1) 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

829 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