Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
Good day!
My Claendar QVD contains the following info.
calendar QVD:
LOAD
[Date Key],
[Calendar Name],
[Fiscal Year],
[Fiscal Period],
[Working Day Divisor]
FROM [$(vQvdFile)](qvd);
but i wanted calculate the below SQL logic using the above QVD info. could you please help me out on the same please.
set @iDate = tableX(0) /*value 0 gives today, -1 yesterday etc*/
;with Tmpwd as (
select
Country,
Period,
SUM(workingday) as TotalWrkDays,
sum(case
when [DATE] < @iDate then workingday
else 0
end) MTD_Days
from tbl_workingdays_country
group by
Country,
Period
)
, Cal as (
select a.Country, a.[Date], a.[Period], Tmpwd.TotalWrkDays as TotalPeriodWorkingDays, Tmpwd.MTD_Days as MTD_WorkingDays_Period
from
tbl_workingdays_country a
inner join Tmpwd on
a.country = Tmpwd.country and
a.period = Tmpwd.period
)
many thanks in advance.
Sree
Please don't post multiple times the same request, it makes it hard to follow a discussion.
I've posted an answer to