Solved

IIF Grouping within a Report

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

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
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…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

707 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