Link to home
Start Free TrialLog in
Avatar of Trygve Thayer
Trygve ThayerFlag for United States of America

asked on

Crystal Reports convert date

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.
Avatar of peter57r
peter57r
Flag of United Kingdom of Great Britain and Northern Ireland image

What year does the ' 0 in the second position ' represent?
Avatar of jmyung
jmyung

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
Avatar of Trygve Thayer

ASKER

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.
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))

mlmcc
ASKER CERTIFIED SOLUTION
Avatar of Tarakas4
Tarakas4
Flag of Malawi image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial