Hi experts,
I need to calculate automatically date and have to save in UDF called Date.
Requirement:
Based on Docdate & freight i need to calculate date
Freight i have given in UDF fileds as AIR,BA,SEA.list box
If my freight is AIR -3 days and if its SEA -7 days
My query is working in Row level(RDR1) FMS is working.
I have modified to column level UDF its not working
declare @country nvarchar(2)
declare @Freight nvarchar(3)
declare @Combined nvarchar(5)
SET @country = (Select Country FROM CRD1 WHERE CardCode = $[$4.0.0] AND Address = $[$40.6.0] AND AdresType = 'S')
SET @Freight = (Select $[RDR1.U_No_freight])
SET @Combined = @freight+@country
SELECT CASE @Combined WHEN 'AIRGB' THEN (SELECT DATEADD(DD, -3, $[$38.25.0]))
WHEN 'BAGB' THEN (SELECT DATEADD(DD, -3, $[$38.25.0]))
WHEN 'SEAGB' THEN (SELECT DATEADD(DD, -7, $[$38.25.0]))
End
Please find the attachment of screen shot of row level date calculating for referencecapture.png
Thanks
Vinoth
Add comment