swell
Member
- Local time
- Today, 10:38
- Joined
- Mar 10, 2020
- Messages
- 77
Hi, (moved this from where I incorrectly posted.)
I have what seems to be an eternal problem with crosstab queries and null values.
Here is my simple crosstab query. The data is one month of activity giving total hours and distance in any given month.
Here is my query.
I need a row for every instance of [Activity ID] from the [Activity Type] table, excuse the poor naming, I created these before I was aware of access naming conventions (would rename but frightened it might break something).
The [Activity Type] table has these instances of [Activity ID] 1 through to 13, 21 through to 29 and 41 through to 47. (numeric)
I have seen the statements of using column headings in the property sheet, but these are row headings .
This is output to auto populate a formatted excel spreadsheet (well that's the aim ).
I have what seems to be an eternal problem with crosstab queries and null values.
Here is my simple crosstab query. The data is one month of activity giving total hours and distance in any given month.
Here is my query.
Code:
Sum(ActivityRange.Hours) AS SumOfHours1
SELECT [Activity Type].[Activity ID], [Activity Type].ActivityDesc, Sum(ActivityRange.Hours) AS SumOfHours, Sum(ActivityRange.Distance) AS SumOfDistance
FROM ActivityRange INNER JOIN [Activity Type] ON ActivityRange.Activity = [Activity Type].[Activity ID]
GROUP BY [Activity Type].[Activity ID], [Activity Type].ActivityDesc
ORDER BY [Activity Type].[Activity ID], ActivityRange.[Date of Activity]
PIVOT ActivityRange.[Date of Activity];
I need a row for every instance of [Activity ID] from the [Activity Type] table, excuse the poor naming, I created these before I was aware of access naming conventions (would rename but frightened it might break something).
The [Activity Type] table has these instances of [Activity ID] 1 through to 13, 21 through to 29 and 41 through to 47. (numeric)
I have seen the statements of using column headings in the property sheet, but these are row headings .
This is output to auto populate a formatted excel spreadsheet (well that's the aim ).