Advertisement
hecrus

demo 2 Bar

Oct 17th, 2020
884
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
T-SQL 0.58 KB | None | 0 0
  1. CREATE PROCEDURE [dbo].[dashboard_tst-dashboard_barSumOrders_getPanelChart]
  2. @username nvarchar(128)
  3. AS
  4. BEGIN
  5.     declare @days nvarchar(max)
  6.     select @days = '13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28'
  7.    
  8.     declare @ndays table (n int)
  9.     insert into @ndays
  10.     select value from dbo.split(@days,',') where value <> 0
  11.    
  12.     select 'bar' Type, 'March 2020' Title, 400 Width, 400 Height
  13.    
  14.     select n Title, (select cast(sum(cnt*price) as int) from tst_orders where created between '2020/03/13' and '2020/03/28' and day(created) = n) as Value, '#36b9cc' Color
  15.     from @ndays
  16. END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement