Qry Nested If's and date formats

AmyLynnHill

Registered User.
Local time
Today, 08:54
Joined
Dec 7, 2005
Messages
81
I'm tring to build a queary based on a field called "PLAN_CODE" and a policy issue date field. There are 3 plan codes ...select1, select 2 and select 3.
I want to pull information as follows
Select1 has an issue date 11 months ago (day the queary is ran)
select2 has an issue date 23 months ago
select3 has an issue date 35 months ago

I built a field to calculate the duration of the policy based on the issue date
Duration: (Round((POLICY_ISSUE_DATE]-Date())/365,1)). I think the format is wrong? need help with that!

I built a field to create a nested "IF" statement but the first "IF" is not pulling correctly, so I cant built the remaining "IF" statements.
Expr2: IIf([PLAN_CODE]="SELECT01N" [Duration]=-0.9,0).

Anyone have a better approach? Any input how to handle this? I'm not real good with VB code but have a general understanding of it. It's easier for me to build in the QBE.
 
You're going to have to better explain what you're trying to do. It sounds like you're trying to come up with a list of plans that are a month away from expiring (11, 23, or 35 months ago was their respective start date, if you will), but what you're trying to do with this data is very unclear.

I think this is close:

If Start_Date is 11 months from Todays_Date, then Select1
If Start_Date is 23 months from Todays_Date, then Select2
If Start_Date is 35 months from Todays_Date, then Select3

Explain clearer what you're trying to accomplish, and this is pretty simple.
 
I want the queary to select a PLAN CODE of "Select1" and calclulate from the ISSUE_DATE elapsed time of 11 months and return the POLICY NUMBER. If the PLAN CODE is "Select2" calculate frome the ISSUE_DATE elapsed time of 23 months and return the POLICY NUMBER.

I hope this is more clear, sorry for the confusion. I'm fairly new.....
 

Users who are viewing this thread

Back
Top Bottom