I am trying to write an IIF statement to calculate the days a report has been open. I have to do this because in the database I am linking, the start date gets changed too easily, so I have to calculate the days open this way: DAYS_OPEN: (Date()-([prob_eval_orig_due_dte_tm]-30)) The database automatically assigns a 30 day due date. However now I have some reports due in 45 days. I need to modify my query to say if [cause_type_cd] is equal to "RC" use 45 instead of 30 otherwise use 30 in the days open calc. I assume I could do this in an IIF statement but I am not very good at these. Below is my stab at it but I get syntax error.
Can someone help?
Thanks,
Jim
Code:
DAYS_OPEN: IIf([cause_type_cd]=[RC],(Date()-([prob_eval_orig_due_dte_tm]-45),Date()-([prob_eval_orig_due_dte_tm]-30)))
Can someone help?
Thanks,
Jim