Hello guys,
I have a MAXDate query, that gives the MAX Date between 3 different dates, for me to achieve this I have a module:
Then on the MaxDate query:
My main problem though is, if for example I want to add another column, let's say DueDate2: [MaxDate]+1 it gives an error.
Any idea why it doesn't calculate the date? is it because MaxDate is a function?
Thanks
I have a MAXDate query, that gives the MAX Date between 3 different dates, for me to achieve this I have a module:
Code:
Public Function Maximum(ParamArray MyArray()) As Variant
Dim intLoop As Long
Maximum = Null
For intLoop = LBound(MyArray) To UBound(MyArray)
If IsNull(MyArray(intLoop)) Then
'do nothing
ElseIf IsNull(Maximum) Then
Maximum = MyArray(intLoop)
ElseIf MyArray(intLoop) > Maximum Then
Maximum = MyArray(intLoop)
End If
Next
End Function
Then on the MaxDate query:
Code:
SELECT Job_Tracking.ReportingPeriod, Job_Tracking.LoanNumber, JobTracking_PropertyCount.CountOfLoanNumber AS [Property Count (<>SUM)], Job_Tracking.DateAssigned, Job_Tracking.RushReqDate, Job_Tracking.ResolvedIssueDate, Maximum([DateAssigned],[RushReqDate],[ResolvedIssueDate]) AS MaxDate
FROM Job_Tracking LEFT JOIN JobTracking_PropertyCount ON (Job_Tracking.LoanNumber = JobTracking_PropertyCount.LoanNumber) AND (Job_Tracking.ReportingPeriod = JobTracking_PropertyCount.ReportingPeriod)
GROUP BY Job_Tracking.ReportingPeriod, Job_Tracking.LoanNumber, JobTracking_PropertyCount.CountOfLoanNumber, Job_Tracking.DateAssigned, Job_Tracking.RushReqDate, Job_Tracking.ResolvedIssueDate;
My main problem though is, if for example I want to add another column, let's say DueDate2: [MaxDate]+1 it gives an error.
Any idea why it doesn't calculate the date? is it because MaxDate is a function?
Thanks