'SQL Azure Data Bricks
We have a table 1 Day table aggregated with group by
call_date
,tdlinx_id
,work_request_id
,category_name
another table we have 1 week level data aggregated with group by
week_end_date
,category_name
,sdo_reporting_name
How can I populate the data from day level to week level ???
week_end_date = date_add(call_date, 7-dayofweek(call_date))
Solution 1:[1]
what you need is the following functions:
SELECT current_date() + 7 - dayofweek(current_date());
So, In your case, it would be:
SELECT call_date + 7 - dayofweek(call_date)
FROM your_table;
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | PhuriChal |