Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi, I'm trying to calculate the number of working days between a date and another date calculated using RangeMin since it will choose the lowest date between several as follows:
Workingdays(Date1, RangeMin(date2, date3, date4))
but it doesn't work
thanks in advance for all your help
If your fields were already dates to begin with, then you shouldn't need to do anything special (though it's recommended to apply date(Field) anyway).
If your fields were previously strings or numbers, then you would have to explicitly convert them to dates first. Are your fields currently strings / numbers with the specific format 'YYMMDD' (e.g. 210825)? They would have to be that for your date#() function to work correctly with that syntax.
This works correctly near as I can tell.
Load Today()-10 as StartDate, Today() as Date1, Today()-1 as Date2, Today()+1 as Date3
Autogenerate(1);
NetWorkDays(StartDate,RangeMin(Date1, Date2, Date3)) returns 6 (right now, obviously that will shift depending on what day of the week we're on).
I wrote exactly the same but it doesn't work it returns 0 as result for all the lines
I'd suggest checking that your values all evaluate to valid dates, then. The issue isn't with the formula itself, it's with something going on with your data, since using the same formula on generic data works correctly.
I guess I have to declare the fields as date in some way.
In the script I wrote as follows:
Date(Date#([LADATU], 'YYMMDD'), 'YYYY-MM-DD')
and the same with all the other date fields
If your fields were already dates to begin with, then you shouldn't need to do anything special (though it's recommended to apply date(Field) anyway).
If your fields were previously strings or numbers, then you would have to explicitly convert them to dates first. Are your fields currently strings / numbers with the specific format 'YYMMDD' (e.g. 210825)? They would have to be that for your date#() function to work correctly with that syntax.
now it works! thank you very much for your help, high appreciated!
Sure thing. If possible, could you post what the exact solution was and mark the question solved so others might be able to use it in the future?