Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin.
Search for scripts directly from SSMS, and instantly access any saved scripts in your
SSC briefcase from the favorites tab.
Download now (direct download link)
Thank this author by sharing:
PRINT dbo.ufn_LinearForecast(0, '552,6:313,5:1213,4:1204,3:721,2:428,1')
SELECT dbo.ufn_LinearForecast(0, CAST(JanSales as varchar) + ',' + '1:' + CAST(FebSales as varchar) + ',' + '2:' + CAST(MarSales as varchar) + ',' + '3:' + CAST(AprSales as varchar) + ',' + '4:' + CAST(MaySales as varchar) + ',' + '5:' + CAST(JunSales as varchar) + ',' + '6:') AS ForecastFROM dbo.SalesSummaryWHERE InvoiceDate >= '1/1/2009' AND InvoiceDate < '7/1/2009'
Difference between varchar(max) and varchar(8000)
converting varchar to numeric
any downside to VARCHAR(MAX)?