I'm new to store procedure, some of the syntax i dont know what is the purpose
SELECT
CONVERT(NVARCHAR(10), [TrsDate], 103) AS [Date]
,[TrsDate] As [TransactionDate]
,CAST(YEAR([TrsDate]) AS VARCHAR(4)) AS [TrsYear]
,CASE WHEN MONTH([TrsDate])< 10 THEN '0' ELSE '' END + CAST(MONTH([TrsDate]) AS VARCHAR(2)) AS [TrsMonth]
,CASE WHEN DAY([TrsDate]) < 10 THEN '0' ELSE '' END + CAST(DAY([TrsDate]) AS VARCHAR(2)) AS [TrsDay]
WHERE
b.VoidStatus <> '1'
AND b.TrsDate BETWEEN @p_DateFrom AND @p_DateTo
AND b.SubTotal >= 0
AND b.VoidNote = 0
AND bd.VoidStatus <>'1' AND bd.Quantity >= 0
AND ReversedBill.ReversalBillNo IS NULL
what it try to convert ? case, when, then, end is like the if else? must start from case, than case when?
<>'1' what is this mean? not found when search on internet
Thank for explain to me ~
Go to the complete details ...