J
Jan T.
Can I use Min and Max functions in a query?
I tried to build a query where I had the fields or columns under neath.
In the Column NUMOFDAYS, I tried to write an expression but it just gives
me an error saying; Wrong number of arguments or something like that.
Let's say I wrote a simple expression;
NUMOFDAYS: Min([SICKDATE, OKDATE) just for testing a function.
- it would give me an error. (I even added Group by and Expression).
What do I do wrong?
I want to find out how many days sick in January (see FROMDATE TODATE )
SICKDATE OKDATE FROMDATE TODATE NUMOFDAYS
12/28/2007 01/03/2008 01/01/2008 01/31/2008
3
01/05/2008 01/11/2008 01/01/2008 01/31/2008
6
01/26/2008 02/03/2008 01/01/2008 01/31/2008
5
02/05/2008 02/09/2008 01/01/2008 01/31/2008
0
I tried this formula in Excel and that work like a dream;
NUMOFDAYS
= MIN(TODATE, MAX(OKDATE, FROMDATE)) - MIN(TODATE, MAX(FROMDATE, SICKDATE))
Is it possible to use the same function as an expression in the field
NUMOFDAYS? (In the query builder)
Any suggestions are very much appreaciated.
Regards
Jan T.
I tried to build a query where I had the fields or columns under neath.
In the Column NUMOFDAYS, I tried to write an expression but it just gives
me an error saying; Wrong number of arguments or something like that.
Let's say I wrote a simple expression;
NUMOFDAYS: Min([SICKDATE, OKDATE) just for testing a function.
- it would give me an error. (I even added Group by and Expression).
What do I do wrong?
I want to find out how many days sick in January (see FROMDATE TODATE )
SICKDATE OKDATE FROMDATE TODATE NUMOFDAYS
12/28/2007 01/03/2008 01/01/2008 01/31/2008
3
01/05/2008 01/11/2008 01/01/2008 01/31/2008
6
01/26/2008 02/03/2008 01/01/2008 01/31/2008
5
02/05/2008 02/09/2008 01/01/2008 01/31/2008
0
I tried this formula in Excel and that work like a dream;
NUMOFDAYS
= MIN(TODATE, MAX(OKDATE, FROMDATE)) - MIN(TODATE, MAX(FROMDATE, SICKDATE))
Is it possible to use the same function as an expression in the field
NUMOFDAYS? (In the query builder)
Any suggestions are very much appreaciated.
Regards
Jan T.