Problem Getting Warranty End Date Correct Dd/mm/yy
Hi,
I'm new to the forums but this problem has driven me here out of desperation. We have tags developed offsite for various customers and this one used to be simple until they changed their warranty date requirements.
The Begin date is the Current day + 7 days, in format dd/mm/yy. Easy enough in Bartender.
The problem we are having is the end date. It is specified as Begin date + 3 years 2 months, in format dd/mm/yy. We have yet to be able to get a working solution for this that is right all the time. We've set the Begin date as a Share name WarDate and the month of the Begin as WarMonth.
The End date has just the dd+7 days first, then a script for the month and year. Obviously, today (July 24) plus 2 months 7 days shouldn't be September 31. We then have a script for the Month:
I've attached one of the templates to see if anyone can help. It's the combination of the multiple date additions and the specific date format that is our problem.
Also, I'm in the US so that is not my default date format and I can't change my system date format for just this one tag.
Any help is greatly appreciated as we've had numerous people try at this and it's still not 100%.
Paul
-
Shotaro Ito
★ BarTender Hero ★
Hi Paul,
To add date, use DateAdd vbs function.'get todays date' dateToday = Now() 'add 7 days, then 3 years, then 2 months' dateBegin = DateAdd("d",7,dateToday) dateBegin3yrs = DateAdd("yyyy",3,dateBegin) dateEnd = DateAdd("m",2,dateBegin3yrs) 'reformat to dd/mm/yy' dd = Right("0" & Day(dateEnd),2) MM = Right("0" & Month(dateEnd),2) yy = Right(Year(dateEnd),2) Value = dd & "/" & MM & "/" & yy--
Good news - you can do that without VB Script, in Ver 10.0 or later.
Note that you need 3 text to do that:
Text1: Clock(today) : Type Date : Offset 7 days
Text2: Object value of Text1 : Type Date: Offset 3 years
Text3: Object value of Text2 : Type Date(Format custom dd/MM/yy) : Offset 2 months
hide Text1 and Text2 as these are interim object.0
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
Kommentare
1 Kommentar