Given the following:
Table
Date Name Type
01/04 John A
01/04 Ann B
01/05 John B
01/05 John B
01/06 Ann A
I use the Distinct function to get a summary report:
"Select Distinct name, type, count(type) from table GROUP By name, type;"
Name Count Type
Ann
1 A
1 B
John
1 A
2 B
I want to place a line in the header of the report which
shows the number of days and the average per day:
"Select Distinct name, type, count(type), date from table Group By name, type, date;
Number of days 3
Average per day 1.66
My problem is that when I select the date field to use
the datediff function, I have to use the date field in an
aggregate function which doesn't produce the desired result due to the date:
Ann 1 B
1 A
John 1 A
1 B
1 B
Would I use a join or union or ???
Table
Date Name Type
01/04 John A
01/04 Ann B
01/05 John B
01/05 John B
01/06 Ann A
I use the Distinct function to get a summary report:
"Select Distinct name, type, count(type) from table GROUP By name, type;"
Name Count Type
Ann
1 A
1 B
John
1 A
2 B
I want to place a line in the header of the report which
shows the number of days and the average per day:
"Select Distinct name, type, count(type), date from table Group By name, type, date;
Number of days 3
Average per day 1.66
My problem is that when I select the date field to use
the datediff function, I have to use the date field in an
aggregate function which doesn't produce the desired result due to the date:
Ann 1 B
1 A
John 1 A
1 B
1 B
Would I use a join or union or ???