Convert JDE Julian Date to Gregorian SSRS

  • Does anyone know of an easy method to convert a Julian Date from JD Edwards to Gregorian? I would like to do this in a reporting srvcs project. Thanks

  • Don't know what a JD Edwards Julian Date is so I couldn't at the moment.

  • What I mean is to convert a date from julian to gregorian. Example would be ; Julian - 112074 convert to 03/14/2012 thanks

  • Try this:

    DECLARE @jdejulian INT;

    SET @jdejulian = 112031;

    SELECT

    DATEADD(dd, CAST(RIGHT(RIGHT('0' + CAST(@jdejulian AS VARCHAR), 6),3) AS INT) - 1, DATEADD(yy, CAST(LEFT(RIGHT('0' + CAST(@jdejulian AS VARCHAR), 6),3) AS INT), 0));

  • Working on another way at this time as well.

  • Here is a better way:

    DECLARE @jdejulian INT;

    SET @jdejulian = 112074;

    SELECT DATEADD(dd, (@jdejulian % 1000) - 1, DATEADD(yy, @jdejulian / 1000, 0));

  • And to convert a date >= 1900-01-01 to a JD Edwards Julian date:

    DECLARE @ThisDate datetime;

    SET @ThisDate = GETDATE();

    SELECT (YEAR(@ThisDate) - 1900) * 1000 + DATEPART(dy, @ThisDate);

  • Thank you for your replies. Do I add this in the custom code area?

  • How you implement this in reporting services or JD Edwards code, I'm not sure. What I provided can be used in T_SQL queries.

Viewing 9 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic. Login to reply