Skip to Content

FMS in Sales order

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

capture.png (170.2 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Oct 07, 2017 at 09:54 AM

    Hi,

    I think you will have to use convert function for date.

    Add comment
    10|10000 characters needed characters exceeded