Hello,
We use NiceLabel software for our production/shipping department. Our label fields are taken from SQL table or programmed with VBScript. I have some special assignment now.
I have one table TWeek (Week in a year of production) TYear(year of production). So like 15W-2020Y.
I would like to program formula to convert this table dataWeek and Year to date DD.MM.YYYY
I have found these 2 options in VBScript, but i can't run it. Object required: 'Wscript'
»
Dim year: year = 2016
Dim wn: wn = 45
Dim wd: wd = DateAdd("ww", wn, DateSerial(year,1,1))
WScript.Echo wd - WeekDay(wd, vbMonday) + 1
«
and other option:
»
Function DateYWkWd(year, wn, wd)
' returns date based von VbMondeay and vbFirstFourDays
Jan4 = Dateserial(year,1,4) ' garantied to be in first week
DateYWkWd = DateAdd("ww",wn-1, DateAdd("d",wd-Weekday(Jan4,2),Jan4))
end Function
«
Thank you for help,
Br,
Andrei
We use NiceLabel software for our production/shipping department. Our label fields are taken from SQL table or programmed with VBScript. I have some special assignment now.
I have one table TWeek (Week in a year of production) TYear(year of production). So like 15W-2020Y.
I would like to program formula to convert this table dataWeek and Year to date DD.MM.YYYY
I have found these 2 options in VBScript, but i can't run it. Object required: 'Wscript'
»
Dim year: year = 2016
Dim wn: wn = 45
Dim wd: wd = DateAdd("ww", wn, DateSerial(year,1,1))
WScript.Echo wd - WeekDay(wd, vbMonday) + 1
«
and other option:
»
Function DateYWkWd(year, wn, wd)
' returns date based von VbMondeay and vbFirstFourDays
Jan4 = Dateserial(year,1,4) ' garantied to be in first week
DateYWkWd = DateAdd("ww",wn-1, DateAdd("d",wd-Weekday(Jan4,2),Jan4))
end Function
«
Thank you for help,
Br,
Andrei