Subtracting 2 dates to get days difference S’abonner

0
Avatar
Mark Adamson

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 commentaires

0
Avatar
Pete Thane
Actions pour les commentaires Permalien

Hi,

 

You need to use the DateDiff command as per the image below

 

0
Avatar
Mark Adamson
Actions pour les commentaires Permalien

Thanks Pete,

 

that's brilliant. Thanks for your help.

 

Vous devez vous connecter pour laisser un commentaire.