Crystal Reports convert date

Posted on 2010-04-07
Medium Priority
Last Modified: 2012-06-21
I have a system that uses a modified julian date lot number sequence.  Ex.  B011601  In this example the 0 in the second position represents the year and the 116 represents the julian day of the year.

What I need to do is get the correct syntax to convert this number to a MM/DD/YY format.

Thanks in advance.
Question by:Trygve Thayer
LVL 77

Expert Comment

ID: 30027719
What year does the ' 0 in the second position ' represent?

Expert Comment

ID: 30034867
Is the example you have given a random set of numbers.  From my understanding a Modified Julian Date uses 5 digits.  so the last 5 digits (11601) = 08/22/1890

Author Comment

by:Trygve Thayer
ID: 30049278
To peter57r
The last 2 digits represent a numerical sequence on that day.  01, 02, 03, 04 etc.
To imyung
We may not be using a modified julian but am unable to change the combination.
LVL 101

Expert Comment

ID: 30079503
What date does B0116 represent?

Is this going to be based off 2010 so the 0 is 2010 and when it is 1 it will be for 2011

Try this formula

Local numberVar NumDays;
Local NumberVar AddYears;

AddYears := Val(Mid({YourString},2,1);
NumDays := Val(Mid({YourString},3,3);

DateAdd('d',NumDays , Date(2010+AddYears ,1,1))


Accepted Solution

Tarakas4 earned 2000 total points
ID: 32336589
Use crystal reports functions to:

1. Break down the string- use string functions. Assign this to a variable you define
2. Check for the value and assign to appropriate value
3. Use Date functions to convert the three variables to one date value.

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
How can you see what you are working on when you want to see it while you to save a copy? Add a "Save As" icon to the Quick Access Toolbar, or QAT. That way, when you save a copy of a query, form, report, or other object you are modifying, you…
In this video I will demonstrate how to set up Nine, which I now consider the best alternative email app to Touchdown.
Suggested Courses
Course of the Month4 days, 13 hours left to enroll

601 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question