I am trying to populate a UDF in SAP through a linked query in the user defined field. What I am trying to achieve is: Calculated a predicted shipping date and display this automatically in the field of a service call UDF.
At the moment I have a table with Code, Name and Date. SAP Query is: SELECT min(T0.[U_Date]) FROM [dbo].[@VALIDDELDATES] T0 WHERE T0.[U_Date] >= dateadd(dd, 10, $[$71.0.date])
The trouble is this just adds 10 days to the Date and does not exclude the weekends and bank holidays. I did a mass upload via DTW of valid dates excluding any bank holidays and weekends. Would it be better to do a query where you calculate it off of the Code of say 10 (relating date is 13.08.15) add 10 to the Code which would return 20 (27.08.15) which would be correct but I am unsure of the coding.
The structure of the database is
Name Code Date 10 10 13.08.15 11 11 14.08.15 12 12 17.08.15 13 13 18.08.15 etc
Any advice/help would greatly be appreciated.
asked 18 Aug '15, 11:34