Zum Hauptinhalt gehen

Suche

Suche

Covert YYYY-MM-DD date to Letter for Month, Jan=A, Feb=B, March=C etc

Kommentare

3 Kommentare

  • Avatar
    Peter Thane

    Hi,

    The VB script below should work. It should be set as an Event Controlled>OnPostPrompt script routine.

    I have given the substring that is linked to the Date Picker a name, datechosen, and that is referenced in the first line of the VB and have also made the label field that outputs the converted string a separate field to that used to enter/select the date

    Pete  

    Value = Format.NamedSubStrings("datechosen").Value

    Value1 = Month(Value)

    Value2 = Year(Value)

    Value1 = Mid("ABCDEFGHIJKL", Value1, 1)

    Value2 = Right(Value2,2)

    Value = Value1 & Value2

    0
  • Avatar
    C_S

    Pete,

    Thank you so much. That was exactly what I was looking for and does the job when printed.

    One thing however, it doesn't pull in the YY data in real-time so the barcode in the designer shows as K instead of K20 for example (see below). While not a problem, it might be confusing for someone down the road. What would I need to modify the above code so that it showed A and printed A, and then I can just add the YY back in via another data source. In other words, so I can make the real-time barcode correct.

    0
  • Avatar
    Peter Thane

     

    What do you mean by viewing the barcode in real-time? Is it when you open the label and see it on the screen in Designer or Print Station r some other time? 

    0

Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.