Please be aware that the content in SAP SQL Anywhere Forum will be migrated to the SAP Community in June and this forum will be retired.

Hello,

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

jackalmf's gravatar image

jackalmf
11111
accept rate: 0%

Be the first one to answer this question!
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×17

question asked: 18 Aug '15, 11:34

question was seen: 1,828 times

last updated: 18 Aug '15, 11:34