apestaarten
Technical User
Hello,
I Try to calculate the number of days someone is ill.
I use the following Query :
For the field "Dagen" I get an error if the "Datum Herstelmelding" is null.
When I remove the conversion function CInt the error# disappairs but those fields are empty
So it looks like if I can't add the value B with the rest of the expression.
Who can help me?
Best regards,
Apestaart
I Try to calculate the number of days someone is ill.
I use the following Query :
Code:
SELECT Verzuim.RelID, Verzuim.[Datum ziekmelding], Verzuim.[Datum herstelmelding], Verzuim.Maandnz, Verzuim.[Aantal uren ziek], CInt([B])+CInt(([Datum herstelmelding]-IIf([Datum ziekmelding]>=#7/1/2008#,[Datum ziekmelding],IIf([Datum ziekmelding] Is Not Null,#7/1/2008#,[Datum herstelmelding]-[A])))) AS Dagen, IIf([Datum herstelmelding] Is Null,0,(DatePart("d",[Datum herstelmelding]))) AS A, IIf([Maandnz] Is Null,0,(-DateDiff("d",[Maandnz],DateSerial("2008",DatePart("m",[Maandnz])-1,"1")))) AS B
FROM Verzuim;
For the field "Dagen" I get an error if the "Datum Herstelmelding" is null.
When I remove the conversion function CInt the error# disappairs but those fields are empty
So it looks like if I can't add the value B with the rest of the expression.
Who can help me?
Best regards,
Apestaart