Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello All,
Struggling with an issue which i thought would be rather simple.
I would need to do an bring up some data from SQL based on dates and the difference btwn them should be exactly 10 years.
Ex: If any user opens the app today they should be able to see date ranging from 2/18/2006 to 2/18/2016.
TIA!!
Hi,
Use Addyears function.
Addyears(Date,-10)
Regards,
Kaushik Solanki
May be set a variable like this:
MaxDate:
LOAD Date(AddYears(Max(Date), 10), 'DD-MMM-YYYY') as MaxDate,
Date(Max(Date), 'DD-MMM-YYYY') as MinDate
Resident YourFactTable;
LET vMaxDate = Peek('MaxDate);
LET vMinDate = Peel('MinDate');
DROP Table MaxDate;
SQL
SELECT *
FROM Table
Where DateField >= $(vMinDate) and DateField <= $(vMaxDate);