Hey I'm kind of new in here. I had a profile here 1½ year ago ^^
I'm a little locked down on ideas here so I hope You can help.
I have 2 queries were the structure is the same but each query contains data from two different periods.
The columns contains data or economical numbers such as revenue, margin etc., and with the use of grouping I have colapsed it to show only 18 rows in each report were each row contains the economical data for each of our business segments. The only difference between the two queries is that the first contains current data while the other contains data from last year same period.
So now I could build a report with figures from one of the queries. But I would like to compare today figures with last year figures. So I need a way to take a figure from query one and divide with a figure from query two.
How can I do that?
I have placed the SQL for one of the queries below.
In advance tx
This is the SQL:
I'm a little locked down on ideas here so I hope You can help.
I have 2 queries were the structure is the same but each query contains data from two different periods.
The columns contains data or economical numbers such as revenue, margin etc., and with the use of grouping I have colapsed it to show only 18 rows in each report were each row contains the economical data for each of our business segments. The only difference between the two queries is that the first contains current data while the other contains data from last year same period.
So now I could build a report with figures from one of the queries. But I would like to compare today figures with last year figures. So I need a way to take a figure from query one and divide with a figure from query two.
How can I do that?
I have placed the SQL for one of the queries below.
In advance tx

This is the SQL:
Code:
SELECT Segsort.Sort, [RDRQ-0grouptable].Segment, Segsort.score, Count([RDRQ-0grouptable].KontoNummer) AS AntalOfKontoNummer, Sum([RDRQ-0grouptable].[SumOf# Kat Akt]) AS [SumOfSumOf# Kat Akt], Sum([RDRQ-0grouptable].[SumOfM Omk]) AS [SumOfSumOfM Omk], Sum([RDRQ-0grouptable].SumOfOmsætning) AS SumOfSumOfOmsætning, Sum([RDRQ-0grouptable].[Aktiv i Q0]) AS [SumOfAktiv i Q0], Sum([RDRQ-0grouptable].[SumOf# Fak]) AS [SumOfSumOf# Fak], Sum([RDRQ-0grouptable].[SumOf# Lin]) AS [SumOfSumOf# Lin], Sum([RDRQ-0grouptable].SumOfVareforbrug) AS SumOfSumOfVareforbrug, Sum([RDRQ-0grouptable].MaksOfUnmailable) AS SumOfMaksOfUnmailable, Sum([RDRQ-0grouptable].[SumOfWEB Fak]) AS [SumOfSumOfWEB Fak], Sum([RDRQ-0grouptable].[MaksOf# eMailTilmeldt]) AS [SumOfMaksOf# eMailTilmeldt], Sum([RDRQ-0grouptable].[SumOfWEB Lin]) AS [SumOfSumOfWEB Lin], Sum([RDRQ-0grouptable].[SumOfWEB Oms]) AS [SumOfSumOfWEB Oms], Sum([RDRQ-0grouptable].[Aktiv i Q0 (web)]) AS [SumOfAktiv i Q0 (web)]
FROM Segsort INNER JOIN [RDRQ-0grouptable] ON Segsort.Segment = [RDRQ-0grouptable].Segment
GROUP BY Segsort.Sort, [RDRQ-0grouptable].Segment, Segsort.score
ORDER BY Segsort.Sort;