View Single Post
Old 03-31-2020, 05:08 PM
1695814's Avatar
1695814 1695814 is online now
Join Date: Aug 2002
Studying for nothing. I quit.
Favorite beer: Root
Posts: 39,326

I get "Enter Parameter Value" pop up boxes when I run this query:
SELECT [ValuationPrev].TYPE
, [ValuationCurr].TYPE
, [ValuationPrev].CO
, [ValuationCurr].CO
, [ValuationPrev].LOB
, [ValuationCurr].LOB
, Sum([ValuationPrev].PREMIUM) AS SumOfPREMIUM
, Sum([ValuationCurr].PREMIUM) AS SumOfPREMIUM1
, Sum(IIf([ValuationPrev].[BASE]=1,[CtPrev]=1,[CtPrev]=0)) AS Expr1
, Sum(IIf([ValuationCurr].[BASE]=1,[CtCurr]=1,[CtCurr]=0)) AS Expr2

FROM [ValuationCurr] INNER JOIN [ValuationPrev] ON [ValuationCurr].POLICY = [ValuationPrev].POLICY

GROUP BY [ValuationPrev].TYPE, [ValuationCurr].TYPE, [ValuationPrev].CO, [ValuationCurr].CO, [ValuationPrev].LOB, [ValuationCurr].LOB;
The box notes "CtPrev" & then "CtCurr". I imagine it's the bolded above that's causing it. I don't previously have a variable called "CtPrev" nor "CtCurr". Do those need to be initialized/formatted/somethinged?

What I'm trying to do here is, merge/join records from the previous & current valuation files. For those policies where "[BASE]" is equal to one, that means the Count s/b equal to one. Otherwise, it should be zero.

I imagine I just don't have the syntax correct.

Last edited by 1695814; 03-31-2020 at 05:45 PM..
Reply With Quote
Page generated in 0.17628 seconds with 9 queries