?
Solved

IIF Grouping within a Report

Posted on 2013-11-03
4
Medium Priority
?
378 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
[X]
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
  • 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 2000 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
Suggested Courses

752 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