Hello all,
I am very new to Access. So new that I'm currently creating my first database (in Access). I've done a bit of research, found a post on here that helped me with my syntax, but I'm still not able to get this query to work.
What I'm trying to do:
If the amount of days between the violation date and today is <= 180 then return the number 3, if its between 181 and 365 days then 2, if it's between 366 and 730 days then 1 else 0.
Here's my expression:
IIf(Date()-[Violation Date] < 180, 3,IIf(Date()-[Violation Date] Between 181 And 365, 2, IIf(Date()-[Violation Date] Between 366 And 730, 1, 0)))
Any help would be appreciated. Also, if I'm posting this in the wrong section of the forum, I truly apologize and direction towards the right section would be appreciated.
Thank you very much for your time.
I am very new to Access. So new that I'm currently creating my first database (in Access). I've done a bit of research, found a post on here that helped me with my syntax, but I'm still not able to get this query to work.
What I'm trying to do:
If the amount of days between the violation date and today is <= 180 then return the number 3, if its between 181 and 365 days then 2, if it's between 366 and 730 days then 1 else 0.
Here's my expression:
IIf(Date()-[Violation Date] < 180, 3,IIf(Date()-[Violation Date] Between 181 And 365, 2, IIf(Date()-[Violation Date] Between 366 And 730, 1, 0)))
Any help would be appreciated. Also, if I'm posting this in the wrong section of the forum, I truly apologize and direction towards the right section would be appreciated.
Thank you very much for your time.