View Single Post
Old 04-01-2020, 06:18 PM
Steve Grondin Steve Grondin is offline
Join Date: Nov 2001
Posts: 7,434

Originally Posted by 1695814 View Post
I get "Enter Parameter Value" pop up boxes when I run this query:

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.
Yes. Access is saying I don't know what CtPrev is. It is expecting an expression where you typed CtPrev = 1, so it said "aha a boolean! what is CtPrev?", even though you thought you were giving it an assignment statement.

It look like you want a summary on all matches where old.policyno = new.policyno, grouping by the old.type, new.type,,, old.lob, new.lob. For each grouping you want the total of the old.premium and new.premium and two "new" variables. One is the count of (old.base =1), the other is the count of (new.base = 1).

Meshuga's answer is right. the AS syntax is where you are giving the new column a name. Note that the name is just a display feature within this query (if it were nested, then you could use the name in a higher level). Personally, I would change the two lines above to read AS SumPrevPremium AS SumCurrPremium instead of SumPremium, SumPremium1.
Reply With Quote
Page generated in 0.17051 seconds with 9 queries