IBM Sterling Transformation Extender

Sterling Transformation Extender

Come for answers, stay for best practices. All we're missing is you.


#Sterling
#Supplychain
 View Only
  • 1.  reg date calculation

    Posted 01/06/11 11:59 AM

    Originally posted by: SystemAdmin


    Hi,
    could anybody suggest a way to count the number of days starting from the first day of the year on any given date.

    for eg say today Jan 6 would be 006 , where as Feb 6 would be (31+6)=037.
    also when moving beyond Feb , we'll have to check if its a leap year & hence an extra day.
    #DataExchange
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender


  • 2.  Re: reg date calculation

    Posted 01/06/11 02:20 PM

    Originally posted by: richlee


    Use DATETONUMBER function to convert dates to integers, then subtract one from the other.

    Richard.
    #IBMSterlingTransformationExtender
    #DataExchange
    #IBM-Websphere-Transformation-Extender


  • 3.  Re: reg date calculation

    Posted 01/06/11 02:35 PM

    Originally posted by: john.gibby


    This is very easy to do. For the current date it is as simple as this:

    
    =FROMDATETIME(CURRENTDATE(),
    "{DDD}")
    


    For a specific date, it is just as simple, but if the date you have is a text object, you'll need to convert it to a date. Example: TDate is "07/04/2011"

    
    =FROMDATETIME(TODATETIME(TDate,
    "{MM/DD/CCYY}"),
    "{DDD}")
    


    Of course, if your data object is a date, then you don't need to do that conversion to a date object.
    John
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender
    #DataExchange


  • 4.  Re: reg date calculation

    Posted 01/06/11 04:12 PM

    Originally posted by: SystemAdmin


    thanks for that. Never used that so was unaware
    #DataExchange
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender


  • 5.  Re: reg date calculation

    Posted 01/06/11 02:37 PM

    Originally posted by: Rich_McFate


    It isn't clear what you're trying to do, but be aware that using DDD in a date mask (i.e. in a Type Tree for a date item, or in the date mask of the FromDateTime function) does exactly that. It converts a calendar date (e.g. Feb 2) into the number of days that have elapsed since Jan 1 (033 in the case of Feb 2).

    Rich
    #DataExchange
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender