Date Conversion To Dayname From Sub-String Variable 追蹤

0
Avatar
Legacy Poster

VB Script help

 

I am trying to add a VB script via On Process Data to convert the value of label object string Text 47 to output a weekdayName from a date obtained from a sub-string variable.

 

The sub-string variable will contain a date in the format of DD/MM/YY, from this I would like to modify Text 47 to have the following:-

 

Example:

 

Date contained in sub-string BT_SHIP-COLL_DATE = 03/12/14

 

I would then like the Text 47 object to contain the following:-

 

COLL DAY WED rather than 03/12/14

 

My script so far (not-working) contains:-

 

Dim DateString,DateDayVal,MyDay
DateString = Format.NamedSubStrings("BT_SHIP_COLL_DATE").Value
DateDayVal = Weekday(Datestring)
MyDay= WeekdayName(DateDayVal)

 

Unfortunately VB script is not my Forte

 

Any help would be appreciated

 

Many Thanks

 

 

3 意見

0
Avatar
Legacy Poster
評論操作 永久連結

Just link the text field in question to the date string value, and then you can change the "Data Type" to "Date", and make it a "Custom Format" to display the day how you want. I have attached a screenshot that may help.

 

 

0
Avatar
Legacy Poster
評論操作 永久連結

nRyder

 

Many Thanks for your reply but I am not sure that what you have described above is available to me. The reason is because the version of BarTender we are using is coupled to an ERP system and is based on an older version of BarTender version 9.4 SR3. This must have been made available in a later version - unless I am looking in the wrong place.

 

Sorry I should have listed the version of BarTender in my first post!

 

Regds

Trevorw

0
Avatar
Ian Cummings
版主
評論操作 永久連結

Much of your script is redundant.  You can shorten it to something like the below:

 

Value = WeekDayName(WeekDay("03/12/14"), True)

 

or

 

Value = WeekDayName(WeekDay(Format.NamedSubStrings("BT_SHIP_COLL_DATE").Value), True)

登入寫評論。