简体   繁体   中英

How to get data from SQL for weeks. First day Monday

I am from Europe. First day of the week Monday

Тhis is my code:

set datefirst 1;

select DATEPART(wk, did_dat) as Data, sum(sum_cre) as Suma 
from view_didknobj1 
where sas_kod between '505' and '505'  
  and did_dat between '2019.12.23' and '2019.12.29' 
group by DATEPART(wk, did_dat) 
order by DATEPART(wk, did_dat) asc

This data is returned from this query:

在此处输入图片说明

it should be like that: 52: 23669.77

SET DATEFIRST 1; 

执行上面的sql命令

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM