February 26th, 2014, 01:47 PM
Firebird_ Formular period of employment - error
I´m trying to creat a view to show the period of employment per Member, shown in year, month and days.
A part of the Month-Formular shown an error:
Does anybody knows a solution or has an alternative formular for the period of employment per member?
extract(day from (dateadd(month,datediff(month from -1 to iif(t4.TE is null, t2.EIT, t4.TE)),-1)))
thanks in advance!
P.s.: Sorry for my english :-)
The question I would ask is which one are you trying to show? Are you trying to show years or months or days?
If your trying to combine it you will have problems (just think of trying to depict the year when you have a leap year during it to mess up the calculation).
If you stick to one format it's a lot easier.
Normally (from what I've seen) HR departments want it in one form or another (year / month / day). If you give it in months then it is easier to calculate for legal requirements (assume 12 months = 1 year then you can say that 43 months is 3 years and 7 months).
That way you can get it with the datediff function.
As to the null start date, if it was me I would ask for user input to make a default value that would be used and then make the field not null.