Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setting Criteria Question 1

Status
Not open for further replies.

khurley

IS-IT--Management
Nov 14, 2002
44
US

Hi !

I have field that I want to add to a query that calculates the number of days from todays date to Expiration date of policy. Easy enough to use DateDiff. This calc works for criteria of all policy types equal to A, S or R

BUT

If i have a Policy type of C then i want to substitute Cancel date for Expiration date in the calculation in my query.

I tried creating two different expr fields. EXPR 1 for DAtediff with expiration and another (EXPR 2) for Canceled.

Can i use these in another expr 3 field to compare somehow using if then else logic?

I basically want a field called #of days that will show the correct results based on policy type. If type of policy = A,S or R use EXPR 1 else use Expr 2.

HELP! This will feed a report!
 
Please post your queries' codes. Have you tried something like:
Code:
FinalResult: iif(PolicyType = "A" or PolicyType = "S" or PolicyType = "R",Expr1,Expr2)

?

Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244. Basics at
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top