edgare
Starting Member
1 Post |
Posted - 2006-08-03 : 18:01:59
|
HiI have access 97 and here is the query i get error " Function isn't available in expressions in query expression 'Sum(IIf((Left([month_year],(InStr([month_year],'/'))-1)='1')' Here is the full query why do i get this? How can i fix it? ThanksSELECT Reason_Code.Reason_Description_Major, Reason_Code.Reason_Description_Sub, Count(Claim.Claim_Number) AS Total, Sum(IIf((Left([month_year],(InStr([month_year],'/'))-1)='1'),1,0)) AS Jan, Sum(IIf((Left([month_year],(InStr([month_year],'/'))-1)='2'),1,0)) AS Feb, Sum(IIf((Left([month_year],(InStr([month_year],'/'))-1)='3'),1,0)) AS Mar, Sum(IIf((Left([month_year],(InStr([month_year],'/'))-1)='4'),1,0)) AS Apr, Sum(IIf((Left([month_year],(InStr([month_year],'/'))-1)='5'),1,0)) AS May, Sum(IIf((Left([month_year],(InStr([month_year],'/'))-1)='6'),1,0)) AS Jun, Sum(IIf((Left([month_year],(InStr([month_year],'/'))-1)='7'),1,0)) AS Jul, Sum(IIf((Left([month_year],(InStr([month_year],'/'))-1)='8'),1,0)) AS Aug, Sum(IIf((Left([month_year],(InStr([month_year],'/'))-1)='9'),1,0)) AS Sep, Sum(IIf((Left([month_year],(InStr([month_year],'/'))-1)='10'),1,0)) AS Oct, Sum(IIf((Left([month_year],(InStr([month_year],'/'))-1)='11'),1,0)) AS Nov, Sum(IIf((Left([month_year],(InStr([month_year],'/'))-1)='12'),1,0)) AS Dec, Right([month_year],Len([month_year])-(InStr([month_year],'/'))) AS YearFROM Source_Code INNER JOIN (Reason_Code INNER JOIN (Product_Code INNER JOIN Claim ON Product_Code.Product_Code = Claim.Product_Code) ON Reason_Code.Reason_Code = Claim.Reason_Code) ON Source_Code.Source_Code = Claim.Source_CodeGROUP BY Reason_Code.Reason_Description_Major, Reason_Code.Reason_Description_Sub, Right([month_year],Len([month_year])-(InStr([month_year],'/')))HAVING (((Right([month_year],Len([month_year])-(InStr([month_year],'/'))))="2006"))ORDER BY Count(Claim.Claim_Number) DESC;THANKS  |
|