Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I am very new to QV and am trying to create a report in QV that I will be running every quarterly. I am trying to filter the date field in my SQL select statement in the load script so to load the dashboard with the last quarter data each time. However, I am having no luck. the script is:
OLEDB CONNECT TO XXXXXXXXX
[Table_Name]:
SQL Select ......,
"ETL_DATE",
.........
From "XXXXXX";
The reason for this filter is so that I do not have to load over a million records each time I select "RELOAD" and my QV dashboard does not crash or take many hours when it comes to refreshing the data and can load only the selected dates.
Please can some one help me with this?
SELECT DATEADD(dd, -1, DATEADD(qq, DATEDIFF(qq, 0, GETDATE()), 0)) as LastDayOfPreviousQuarter
SELECT DATEADD(qq, DATEDIFF(qq, 0, GETDATE()) - 1, 0) as FirstDayOfPreviousQuarter
SELECT DATEADD(qq, DATEDIFF(qq, 0, GETDATE()), 0) FirstDayCurrentQuarter
SELECT DATEADD (dd, -1, DATEADD(qq, DATEDIFF(qq, 0, GETDATE()) +1, 0)) LastDayCurrentQuarter
Select *
FROM SomeTable
WHERE SomeDateColumn BETWEEN DATEADD(qq, DATEDIFF(qq, 0, GETDATE()), 0) AND DATEADD(dd, -1, DATEADD(qq, DATEDIFF(qq, 0, GETDATE()) +1, 0));
Thank you so much William