×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Julian date to variable

Julian date to variable

Julian date to variable

(OP)
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 --> VBS

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

RE: Julian date to variable

For starters, get rid of the quotes around DateDiff's two date parameters:
julianDate=DateDiff("y", fromDate, toDate)

RE: Julian date to variable

>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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close