Hi everybody!
I have an issue with a query I would like to perform. I have a table with the field 'Hire Date'. I have performed a datediff between the hire date and today. This returns me how many years the person is in the company.
Depending on the amount of time, the person will have different amounts of vacations day. For example:
- less than 5 years: 15 days
-Between 5 and 10 years: 21 days
-More than 10 years: 30 days.
So I would like to perform an Iif function to return me how many days of vacations has the person depending on the results of the datediff. I have the following:
I tried to keep it simple to see if I could make it work, but it didn't. It says I have entered invalid syntax.
Do you know if I can make it return numbers instead of words and why is it wrong? I am copying the format I have seen in the internet.
Thanks!
I have an issue with a query I would like to perform. I have a table with the field 'Hire Date'. I have performed a datediff between the hire date and today. This returns me how many years the person is in the company.
Depending on the amount of time, the person will have different amounts of vacations day. For example:
- less than 5 years: 15 days
-Between 5 and 10 years: 21 days
-More than 10 years: 30 days.
So I would like to perform an Iif function to return me how many days of vacations has the person depending on the results of the datediff. I have the following:
Code:
IIf([DateDiff]< 5, '15', 21')
I tried to keep it simple to see if I could make it work, but it didn't. It says I have entered invalid syntax.
Do you know if I can make it return numbers instead of words and why is it wrong? I am copying the format I have seen in the internet.
Thanks!