Solved

IIF Grouping within a Report

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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

In Debugging – Part 1, you learned the basics of the debugging process. You learned how to avoid bugs, as well as how to utilize the Immediate window in the debugging process. This article takes things to the next level by showing you how you can us…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

757 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

20 Experts available now in Live!

Get 1:1 Help Now