Subtracting 2 dates to get days difference Follow
Hello,
I've got 2 dates - UseBy & DepotDate.
By subtracting the 2 dates I have calculated the product shelf life which i need for the label.
I use the vb below and with the dates formatted as dd/mm/yy I get a script error. The only way I can get it to work is if I convert the dates to Julien date.
However that will trip over when we start 2021 as depot date maybe in 2020 and the use by in 2021
Format.NamedSubStrings("UseBy").Value - Format.NamedSubStrings("DepotDate").Value
How can i get around this?
2 comments
0

Pete Thane
Comment actions
Hi,
You need to use the DateDiff command as per the image below
Please sign in to leave a comment.