Please be aware that the SAP SQL Anywhere Forum will be shut down on August 29th, 2024 when all it's content will be migrated to the SAP Community.


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, $[$])

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

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



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "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:


question asked: 18 Aug '15, 11:34

question was seen: 1,891 times

last updated: 18 Aug '15, 11:34