Hi,
I have a query where I'm trying to calculate the number of days between 2 fields. There are some fields which don't have a date/are null. I want to make the result for those a zero. I have tried a few different ways (iif statement, Nz function, IsError etc) nothing seems to work. Below is a sample of one of the formulas I tried to get the total # of days. So Date1 and Date 2 will always have a date, but then I need it to subtract the number of days between Dates 3 and 4. Sometimes Dates 3 and 4 could be null, so I want those to be 0:
WorkDays([Date1],[Date2])-IIf([Date3],[Date4]) Is Null,0,WorkDays([Date3],[Date4]))
Any help would be greatly appreciated!
I have a query where I'm trying to calculate the number of days between 2 fields. There are some fields which don't have a date/are null. I want to make the result for those a zero. I have tried a few different ways (iif statement, Nz function, IsError etc) nothing seems to work. Below is a sample of one of the formulas I tried to get the total # of days. So Date1 and Date 2 will always have a date, but then I need it to subtract the number of days between Dates 3 and 4. Sometimes Dates 3 and 4 could be null, so I want those to be 0:
WorkDays([Date1],[Date2])-IIf([Date3],[Date4]) Is Null,0,WorkDays([Date3],[Date4]))
Any help would be greatly appreciated!