RubberChicken
Registered User.
- Local time
- Today, 04:16
- Joined
- Jun 24, 2013
- Messages
- 18
Hi all
I have a like statement in my VBA that is not returning all the possible results.
There are 3 segments AMS, AMS Red & AMS Blue but the code below is only returning values for AMS.
Any help really appreciated!
I have a like statement in my VBA that is not returning all the possible results.
There are 3 segments AMS, AMS Red & AMS Blue but the code below is only returning values for AMS.
Any help really appreciated!
Code:
Set rst = dbs.OpenRecordset("SELECT tblSummaryValues.MonthEndDate, " _
& "Sum([Current]+[30]+[60]+[90]+[120]+[180]) AS [Total Outstanding], " _
& "Sum(tblSummaryValues.Current) AS SumOfCurrent, Sum(tblSummaryValues.[30]) AS SumOf30, " _
& "Sum(tblSummaryValues.[60]) AS SumOf60, Sum(tblSummaryValues.[90]) AS SumOf90, " _
& "Sum(tblSummaryValues.[120]) AS SumOf120, Sum(tblSummaryValues.[180]) AS SumOf180, " _
& "Sum([30]+[60]+[90]+[120]+[180]) AS Collectable " _
& "FROM tblSummaryValues " _
& "GROUP BY tblSummaryValues.MonthEndDate, tblSummaryValues.Segment " _
& "HAVING (((tblSummaryValues.MonthEndDate)=#" & sDate & "#) " _
& "AND ((tblSummaryValues.Segment) like 'AMS*'));")