Safety Lead Time Conversion

I need to use the Item and/or Stockkeeping Unit Safety Lead Time for calculations in an external planning application. Are there any examples of how to convert the information in the SQL Server Safety Lead Time varchar field to an integer that represents a span of days?

Thank you.

NewDate := CALCDATE(“Safety Lead Time”,OldDate);
MyInteger := NewDate - OldDate;

I think that should work.

Thanks for the response.

Unfortunately, the application that uses the data is not written in C/SIDE. It is a “stand-alone” C# application. The majority, if not all of the times, the Lead Time will be in days. I’m probably going to have to write a translation routine.

an easier solution would be to not use the navision field, but instead create your own new field in Navision, then it could be an integer instead of the Navision date calc field

this leaves Navision standard, you could even use the formula above to populate your new field, that way users would never even know it existed, you wouldn’t have to change any forms or anything.

just an idea.

Thanks. That seems to be the best (and standard) way to handle integrations with NAV.