Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Julian date to variable

Status
Not open for further replies.

DanaSkyware

IS-IT--Management
Apr 13, 2017
1
US
Hello all,

I'm a newbie-hack that googles to find the basic functions for what I need Seagull's Bartender barcode application to automate for our label printing.

Current project is to create a label with a Julian Date, YY, Z, XXXX as the full string. YY= 2 digit year, Z= Shift code and XXXX is the number to increment up at the start of each shift.

I'm banging my head on what should be really simple, the Julian date.

Code:
Dim toDate
toDate=Date()

Dim fromDate
fromDate=DateValue("01-Jan")

Dim julianDate
julianDate=DateDiff("y","fromDate", "toDate")

When I run this in Bartender's internal script editor, it gives string type mismatch error. If I test just the toDate code in VbsEdit it returns #4/13/2017#, Bartender shows just 4/13/2017.

VbsEdit, returns fromDate as an empty value.

Testing just fromDate in bartender gives me 1/1/2017.

Any idea what is going wrong? I would so appreciate any help that can be provided.

Dana
 
For starters, get rid of the quotes around DateDiff's two date parameters:
[tt]julianDate=DateDiff("y", fromDate, toDate)[/tt]
 
>VbsEdit it returns #4/13/2017#, Bartender shows just 4/13/2017

That's just a display quirk. VbsEdit is determining and indicating the underlying datatype held by the variant (that's what the # shows), whilst BarTender doesn't bother.

>VbsEdit, returns fromDate as an empty value.

Cannot duplicate this. Works fine here.

> create a label with a Julian Date

Er ... nothing here appears to be a Julian date in any sense.

>it gives string type mismatch error

See guitarzan's post above
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top