Skip to Content
author's profile photo
Former Member

Julian Style Date Formatting

Post Author: Brian Black

CA Forum: Formula

Our AS/400 based banking software provides dates in the format yyyyddd (i.e. 2007091 = April 01, 2007). Has anyone had any experience working with a date of this format in Crystal. The date comes out of the system as a numeric type. The year is easy to deal with via cstr() and left(), etc. but I am struggling with how to deal with the yyy portion in a way that deals with leap years, etc.

Any help with how to convert this to a standard date type would be greatly appreciated!!!

Thanks,

Brian Black

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • author's profile photo
    Former Member
    Posted on Sep 28, 2007 at 05:05 PM

    Post Author: SKodidine

    CA Forum: Formula

    Check out this post with the same issue.

    http://technicalsupport.businessobjects.com/cs/forums/thread/6221.aspx

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Sep 28, 2007 at 08:21 PM

    Post Author: Brian Black

    CA Forum: Formula

    Awesome. That worked great.

    NUMBERVAR X := YYYYddd; //Your date//DATESERIAL(TONUMBER(TOTEXT(X,0,'','')[1 TO 4]),1,TONUMBER(TOTEXT(X,0,'','')[5 TO 7]));

    This is a huge time saver for me!

    Thanks!

    Add comment
    10|10000 characters needed characters exceeded