Hi community,
first of all, sorry for my bad english, I'm doing by best!
I've a question. I need to get database-entries for the last full 20 weeks, but the query should be dynamic.
Example for data-entries for the last full 12 months:
WHERE
CAST(i.Timestamp_TS AS DATE) > ADD_MONTHS(date - EXTRACT(day FROM date) +0, -13) +0
AND
CAST(i.Timestamp_TS AS DATE) < CAST(CURRENT_DATE as DATE)
I need a funktion like this but like I said, for the last full 20 weeks. No Matter when I start the query.
But I guess i cannot do this with that function!?
Is it possible to make this without using table "Sys_Calendar.Calendar"?
Thanks for reading and answering!
Greets!
Forums: