CA Service Management

 View Only
  • 1.  PdmToday() Adjust To The Middle Of The Day?

    Posted Oct 13, 2016 05:27 PM

    Hello,

     

    I've been asked to create a report that can be run on demand, that goes back 1 week to midday (12:00)pm.

     

    Does anyone know how to achieve this with the PdmToday() function? Using 0 on the 'timeAdj' doesn't seem to work.

     

    PdmToday() [timeAdj [, day [, month [, year]]]] ) Evaluates to today's date (in seconds from 1/1/1970), adjusted according to the arguments:

     

    timeAdj:-1—adjust time to beginning of day (0:00:00); +1—adjust time to end of day (23:59:59)

     

    day: negative—adjust date by number of days specified positive—set day to absolute value specified (or to last day of month, whichever is less)

     

    month: negative—adjust date by number of months specified

     

    Thanks Stuart

     
    Using SDM 12.9 & CABI (Build Number:1983  & Product Version: 12.7.0.1983)



  • 2.  Re: PdmToday() Adjust To The Middle Of The Day?

    Posted Oct 13, 2016 08:03 PM

    I'm trying this method, and I'll schedule the report to run at midday.

     

    casd.chg.sched_start_date  BETWEEN PdmAddDays(-6) AND PdmAddDays(1)



  • 3.  Re: PdmToday() Adjust To The Middle Of The Day?
    Best Answer

    Posted Oct 17, 2016 04:19 AM

    To my understanding a value of 0 is not allowed for the timeAdj argument.

    So whats about the following approach:

       PdmToday(-1,-7) will give you middnight one week back,

    adding 43200 (12*60*60)

       PdmToday(-1,-7)+43200

    will give you one week back midday....

    Hope that helps

    Kind regards

    ...........Michael



  • 4.  Re: PdmToday() Adjust To The Middle Of The Day?

    Posted Oct 17, 2016 04:46 AM

    Thanks heaps Michael