With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.
SELECT t = (SELECT
cp.id AS cpid
,cp.customerSrcRef AS cr
,cp.productSrcRef AS pr
,CONVERT(DATE, cp.validFrom) AS vf
,CONVERT(DATE, cp.validTo) AS vt
--,CONVERT(DECIMAL(10, 2), ((cp.rate/100) * pr.rate) + pr.rate) AS p
,cp.price as p
,cp.active AS en
,cp.modifiedDate AS md
FROM dbo.accountManagerCustomer amc
INNER JOIN dbo.customerPrice cp ON amc.customerSrcRef = cp.customerSrcRef
WHERE amc.enabled = 1 AND amc.deleted=0
AND cp.validTo >= CAST(GETDATE() AS DATE) AND cp.active = 1
--AND ((@isFullCustomersAM = 0 AND amc.accountManagerRef = @accountManagerId) OR @isFullCustomersAM != 0)
ORDER BY cp.id
FOR JSON PATH, ROOT ('root'))
Open in new window
DECLARE @x NVARCHAR(MAX) = (SELECT ... FOR JSON )
Please enter a first name
Please enter a last name
Must be at least 4 characters long.
Join and Comment
From novice to tech pro — start learning today.
Premium members can enroll in this course at no extra cost.
Premium members get this course for $159.20.
Premium members get this course for $37.50.
Premium members get this course for $389.00.
Premium members get this course for $62.50.
Premium members get this course for $167.20.
Premium members get this course for $49.99.