skip to Main Content

SQL Server JSON group

I'm trying to transform my table to JSON My table: DROP TABLE IF EXISTS #tmp CREATE TABLE #tmp(AnalyticGoodsT CHAR(6), date SMALLDATETIME) INSERT INTO #tmp(AnalyticGoodsT, date) VALUES ('000001', '20230424'), ('000002', '20230424'), ('000003', '20230424'), ('000004', '20230424') Required JSON format(i'm trying to group…

VIEW QUESTION

grouping elements of array – Javascript

I have a array as follows : data = [ { "type":"abc", "quantity":36, "code:"EDF" }, { "type":"abc", "quantity":40 "code:"SFDF" }, { "type":"yrf", "quantity":22 "code:"SFDF" }, { "type":"yrf", "quantity":19 "code:"EDF" } ] I want to group elements of this array on…

VIEW QUESTION

how to get sundays in given period – Javascript

<script> var startDate = "2023/04/01"; var endDate = "2023/04/16"; var dateMove = new Date(startDate); var strDate = startDate; while (strDate < endDate){ var strDate = dateMove.toISOString().slice(0,10); array.push(strDate); dateMove.setDate(dateMove.getDate()+1); }; $('.show').html(array); </script> result"2023/04/01","2023/04/01","2023/04/02","2023/04/03","2023/04/04","2023/04/05","2023/04/06","2023/04/07","2023/04/08","2023/04/09","2023/04/10","2023/04/11","2023/04/12","2023/04/13","2023/04/14","2023/04/15","2023/04/16" how to get results on Sundays 2023/04/02,2023/04/09,2023/04/16

VIEW QUESTION
Back To Top
Search