I am trying to collate several tables into a single row display for reporting purposes - all on a date time value. I do not have an issue when joining disparate tables on say a CTE of datetime values. When I encounter a table with a different FK I get too many records for this to work. Example
Reporting Structure
DateTime EngineName EngineValue PartName PartValue Part2Name Part2Value
20160118 00:00 Engine1 100 Part1 100 Part2 200
Engine Table
DateTime EngineName EngineValue
20160118 00:00 Engine1 100
Part Table
DateTime Name(fK) Value
20160118 00:00 Part1 100
20160118 00:00 Part2 200
At this point I have tried to create a CTE of datetimes and join the logs to the CTE on the datetime. I can't get this work and I know I'm not the first to create reports like this.