Skip to main content
Answer

Using a UDF (Combo) for value to subtract from a date field

  • October 16, 2025
  • 2 replies
  • 36 views

I am trying to use a UDF attached to the customer for a numeric field (1-10) to subtract days from a date field (=DateAdd([SOOrder.RequestDate], 'd', -[Customer.AttributeCUSTRANSIT])), If I use a Number in place of the Attribute this works fine, I need to have the attribute value so this is dynamic by customer order. (Note: I am already using Lead time for another function, and this is a separate calculation). I have tried all the operators and cannot get anything that will use the attribute field in the calculation. I am open to any suggestions!

Best answer by miguel80

Hi!

Try converting it to an integer first:

=DateAdd([SOOrder.RequestDate], 'd', -CInt([Customer.AttributeCUSTRANSIT]))

2 replies

miguel80
Semi-Pro III
Forum|alt.badge.img+3
  • Semi-Pro III
  • Answer
  • October 16, 2025

Hi!

Try converting it to an integer first:

=DateAdd([SOOrder.RequestDate], 'd', -CInt([Customer.AttributeCUSTRANSIT]))


  • Author
  • Freshman I
  • October 16, 2025

I swear i tried that more than once…., but I copied and pasted and yes it did work! Thanks for answering my question, allows me to move to the next steps! Appreciate the help!