-2
[Crystal Reporter] []1
I have this screen, I need to build a map that shows me the Monthly and Annual Analysis at the same time, but, from a query and not specific tables only that in this query I need a filter that is the year (2019) of the above Image.
How do I get the form 2019 insert into the map without using parameters? follows the query( the year (2019) needs to come from the form):
select *
from (
select a.rubrica,
Jan=isnull((select sum(jan.acum) from AcRubricas jan where jan.rubrica=a.rubrica and month(dataac)=1 and year(dataac)=2019 ),0) ,
Fev=isnull((select sum(jan.acum) from AcRubricas jan where jan.rubrica=a.rubrica and month(dataac)=2 and year(dataac)=2019 ),0),
Marc=isnull((select sum(jan.acum) from AcRubricas jan where jan.rubrica=a.rubrica and month(dataac)=3 and year(dataac)=2019 ),0),
Abr=isnull((select sum(jan.acum) from AcRubricas jan where jan.rubrica=a.rubrica and month(dataac)=4 and year(dataac)=2019 ),0),
Mai=isnull((select sum(jan.acum) from AcRubricas jan where jan.rubrica=a.rubrica and month(dataac)=5 and year(dataac)=2019 ),0),
Jun=isnull((select sum(jan.acum) from AcRubricas jan where jan.rubrica=a.rubrica and month(dataac)=6 and year(dataac)=2019 ),0),
Jul=isnull((select sum(jan.acum) from AcRubricas jan where jan.rubrica=a.rubrica and month(dataac)=7 and year(dataac)=2019 ),0),
Ago=isnull((select sum(jan.acum) from AcRubricas jan where jan.rubrica=a.rubrica and month(dataac)=8 and year(dataac)=2019 ),0),
Sept=isnull((select sum(jan.acum) from AcRubricas jan where jan.rubrica=a.rubrica and month(dataac)=9 and year(dataac)=2019 ),0),
Outb=isnull((select sum(jan.acum) from AcRubricas jan where jan.rubrica=a.rubrica and month(dataac)=10 and year(dataac)=2019 ),0),
Nov=isnull((select sum(jan.acum) from AcRubricas jan where jan.rubrica=a.rubrica and month(dataac)=11 and year(dataac)=2019 ),0),
Dez=isnull((select sum(jan.acum) from AcRubricas jan where jan.rubrica=a.rubrica and month(dataac)=12 and year(dataac)=2019 ),0)
from AcRubricas a where year(a.DataAc)=2019 group by a.Rubrica) mensal
inner join
(select rubrica,sum(Acum) as Acumulado,sum(orca) as Orcamento,( sum(orca) - sum(Acum)) as desvio from AcRubricas where year(DataAc)=2019 group by rubrica) anual on anual.rubrica = mensal.Rubrica
I have often had problems filtering the data to present and avoid using because when making the sum use all the data until the not shown. obgdo by suggestion. I realized that I have no chance without the parameters is this? I made a new map and I’m having another error. error follows:"This field name is not known. Details: errorKind Error in BALS01 {5B2E11DD-6324-4390-8E03-157B7850BFA2}. rpt: Record Selection: '{Accumulationsrubrics.posto}=1' This field name is not known. Details: errorKind"
– Victorino Buta