A given date + 1 hour

Hi guys,
I have a quick question for ya that I am hoping is not to hard. I currently have a date time field and basically all I want to do is add 1 hour to this field and was wondering if its as simple as doing + 0.041666.
ie , if i select sysdate + 0.041666 from dual that gives me exactly 1 hour from the current datetime, but I was wondering is there a more accurate way to do this or a different method to do this to ensure it is correct? as 1/24 is actually 0.0416666666666666666667 or whatever I am just curious as to if my method is the correct way to do this.
Thanks.

Hi,
See below query:
select
  i
  ,to_char(d, 'hh:mm:ss') d
  ,to_char(s1, 'hh:mm:ss') s1
  ,to_char(s2, 'hh:mm:ss') s2
from
  dual
model
dimension by (0 x)
measures (0 i, sysdate d, sysdate s1, sysdate s2)
rules
iterate (1e6) until (to_char(d[0], 'ss') != to_char(s2[iteration_number + 1], 'ss') )
s1[iteration_number + 1] = d[0] + (iteration_number + 1) / 24
,s2[iteration_number + 1] = d[0] + (iteration_number + 1) * 0.041666
,i[iteration_number + 1] = iteration_number +1
I D        S1       S2    
0 06:08:58 06:08:58 06:08:58
1          07:08:58 07:08:58
2          08:08:58 08:08:58
3          09:08:58 09:08:58
4          10:08:58 10:08:58
5          11:08:58 11:08:58
6          12:08:58 12:08:58
7          01:08:58 01:08:58
8          02:08:58 02:08:58
9          03:08:58 03:08:57
10 rows selected Explenation:
The above query generates a list of dates (formated in time only). After each iteration of the rules in the model clause we add 1/24 to s1 and 0.041666 to s2.
The iteration is done maximum 1e6 (1 milion) times but when the seconds part of the original date and the date in s2 are not equal we also stop.
You see that after adding only 9 time 0.041666 to a date you have an offset of 1 second already.
I tried with the 1/24 but even after milions of iterations it still has the same number of seconds.
So you see you may not use the 0.041666 if you intend to ad more then 8 hours.
Regards,
Peter

Similar Messages

  • Working hours of an employee between a given date range

    Hi Everyone,
    how to calculate working hours of an employee between a given date range
    Please anyone qive me some idea..
    Thanks in advance

    Hi Lathessh,
    Thanks for the reply here is the sample data. Actually we have two datetime field and i want to calculate the Ageing of an employee , by excluding of sunday and holiday between startdate and endDate.
    Ageing should be in hours.   Thanks
    StartDateTime
    EndDateTime
    HolidayList
    2/24/2014 11:55
    3/1/2014 16:45
    1/1/13 0:00
    2/24/2014 12:08
    2/28/2014 12:55
    1/14/13 0:00
    2/24/2014 16:16
    2/28/2014 15:20
    1/25/13 0:00
    2/14/2014 12:56
    3/4/2014 16:20
    3/27/13 0:00
    2/14/2014 12:56
    3/4/2014 16:20
    3/29/13 0:00
    2/14/2014 12:56
    3/4/2014 16:20
    4/24/13 0:00
    2/14/2014 12:56
    3/4/2014 16:20
    5/1/13 0:00
    2/26/2014 13:53
    3/4/2014 16:20
    8/9/13 0:00
    2/27/2014 12:13
    3/5/2014 13:05
    8/15/13 0:00
    3/3/2014 14:42
    3/5/2014 17:05
    8/20/13 0:00
    3/3/2014 14:42
    3/5/2014 17:05
    8/28/13 0:00
    3/3/2014 14:42
    3/5/2014 17:05
    9/18/13 0:00
    3/6/2014 12:28
    3/6/2014 17:55
    10/2/13 0:00
    3/6/2014 12:59
    3/7/2014 13:55
    10/16/13 0:00
    3/6/2014 14:37
    3/7/2014 11:15
    11/5/13 0:00
    3/6/2014 14:57
    3/7/2014 12:10
    11/15/13 0:00
    3/4/2014 17:21
    3/10/2014 15:55
    12/4/13 0:00
    3/4/2014 17:21
    3/10/2014 15:55
    12/25/13 0:00
    3/6/2014 12:08
    3/10/2014 14:10
    12/31/13 0:00
    3/6/2014 13:31
    3/10/2014 13:05
    1/1/14 0:00
    3/6/2014 13:14
    3/11/2014 13:20
    1/14/14 0:00
    3/6/2014 13:14
    3/11/2014 13:20
    3/17/14 0:00
    3/11/2014 14:29
    3/13/2014 11:20
    4/8/14 0:00
    3/11/2014 14:29
    3/13/2014 11:20
    4/14/14 0:00
    3/12/2014 12:56
    3/13/2014 11:45
    4/18/14 0:00
    3/12/2014 12:56
    3/13/2014 11:45
    5/1/14 0:00
    3/12/2014 14:02
    3/12/2014 18:10
    7/29/14 0:00
    3/12/2014 14:22
    3/12/2014 18:05
    8/15/14 0:00
    2/24/2014 16:49
    3/14/2014 12:10
    8/18/14 0:00
    2/24/2014 16:49
    3/14/2014 12:10
    8/29/14 0:00
    2/24/2014 16:49
    3/14/2014 12:10
    10/2/14 0:00
    2/24/2014 16:49
    3/14/2014 12:10
    10/3/14 0:00
    3/12/2014 11:31
    3/14/2014 15:55
    10/6/14 0:00
    3/12/2014 13:31
    3/15/2014 12:20
    10/23/14 0:00
    3/12/2014 15:31
    3/15/2014 11:10
    10/24/14 0:00
    3/12/2014 15:49
    3/14/2014 13:55
    12/25/14 0:00
    3/12/2014 16:19
    3/14/2014 15:05
    12/31/14 0:00

  • How to get the total time spent by a Portal User for a given Date?

    Hello,
    We need to develop a Daily Audit Track Report that displays
    the Users logged into our System for a given day and the total login duration in Hours( should include all the
    Login-Logouts of a given date).
    While Portal30_SSO.WWSSO_AUDIT_LOG_TABLE$ can help me get the Users login to Portal for a day, there is no Login/Logout periods in it.
    Any help would be appreciated.
    Thanks
    Madhav

    You may want to consult with the view WWLOG_ACTIVITY_LOGS. Not sure how your environment is configured, but ours includes two WWLOG_ACTIVITY_LOG tables (1 & 2). These tables purge themselves based on your configuration. In other words, Portal will log activity in WWLOG_ACTIVITY_LOG1$ for a certain period of time, then switch to WWLOG_ACTIVITY_LOG2$ while purging the first one. You can specify the purge timetable in the Adminster tab of the Admin page (under Global Settings). If you just key on just 1 log table, you're logs may someday go blank.
    The actions used are 'login' and 'logout'. You can link the actions using the key_1 and key_2 columns of the view. From our current experience, Portal does not account for users that simply close the browser. In other words, we have not been able to get a log event for the action 'logout' for the same key_2 value if someone does this.

  • Find the 'DAY' for a given 'DATE'

    Hi Folks,
    I need a help regarding finding the day for a given date.
    My requirement is that..,
             If I enter a date using 'parameters', it should write the 'day' for the corresponding date.
    To be more specific.....,
    if I enter date as ' 07/15/2008 ' it should return me  the day as 'Tuesday'.
    Regards,
    Naveen G

    HI,
    FM LIST WITH RESPECT TO DAY, WEEK, AND MONTH.
    CALCULATE_DATE : Calculates the future date based on the input .
    DATE_TO_DAY : Returns the Day for the entered date.
    DATE_COMPUTE_DAY : Returns weekday for a date
    DATE_GET_WEEK : Returns week for a date
    RP_CALC_DATE_IN_INTERVAL : Add days / months to a date
    MONTHS_BETWEEN_TWO_DATES : To get the number of months between the two dates.
    END_OF_MONTH_DETERMINE_2 : Determines the End of a Month.
    HR_HK_DIFF_BT_2_DATES : Find the difference between two dates in years, months and days.
    FIMA_DAYS_AND_MONTHS_AND_YEARS : Find the difference between two dates in years, months and days.
    MONTH_NAMES_GET : Get the names of the month
    WEEK_GET_FIRST_DAY : Get the first day of the week
    HRGPBS_HESA_DATE_FORMAT : Format the date in dd/mm/yyyy format
    SD_CALC_DURATION_FROM_DATETIME : Find the difference between two date/time and report the difference in hours
    L_MC_TIME_DIFFERENCE : Find the time difference between two date/time
    HR_99S_INTERVAL_BETWEEN_DATES : Difference between two dates in days, weeks, months
    LAST_DAY_OF_MONTHS : Returns the last day of the month
    DATE_CHECK_PLAUSIBILITY :Check for the invalid date.
    Reward points if useful,
    siri

  • How to get period date of for a given month from a given date in mdx for SSRS report (mm/dd/yyyy)

    I have a situation,  where i need to write expression Period to date(PTD). i want to know how to get the period date. i want you to help in writing Period date or else is there any function to get period date for a given date(the  date is given
    from the parameter dynamically) in MDX for SSRS report
    ram

    Hi ram,
    Per my understanding that you want to get the period date based on the month selected and the given date, right?
    Could you please provide details information below to help us better understanding your requirements, thus we will be more effective to provide an solution:
    What is the format of the period date you want to get, is this date in the DB and you want to filter it based on the month and the given Date?
    Did the month and given date are two parameters in the report? if possible, could you please provide some sample data in the DB and also the snapshot of the report structure
    I assume you want to get the period date(mm/dd/yyy) between the select month(e.g:Feb) and the given date (10/1/2014) and you should get the date between(02/01/2014-10/1/2014).
    If so,and you also have two parameter "Month","EndDate"(EndDate is the given date), please reference to details information below:
    You can create an new parameter "BeginDate" (Date/Time) which is the begin date of the period, you can use the expression to get the value based on the value of the month and the year value from the given date,finally hide this parameter:
    Specify the available value:
    Label:=Parameters!Month.Value &"/01/"& DatePart("yyyy",Parameters!EndDate.Value)
    Value:=CDate(=Parameters!Month.Value &"/01/"& DatePart("yyyy",Parameters!EndDate.Value))
    Specify the default Value:
    Value:=CDate(=Parameters!Month.Value &"/01/"& DatePart("yyyy",Parameters!EndDate.Value))
    Add filter to the dataset as below:
    Preview you will get all the date in the given Period:
    If you still have any problem, please feel free to ask.
    Regards
    Vicky Liu

  • Difference between sy-datum and any given date

    Dear Friends;
    I have one query  regarding DATE  I wanna calculate the difference between
    SY-DATUM and ANY GIVEN DATE . Is there any function or code available that take one parameter as sy-datum and another parameter as any given date and give result as no. of days between them
    Regards;
    Parag

    DATA: DATEDIFF TYPE P.
    CALL FUNCTION 'SD_DATETIME_DIFFERENCE'
      EXPORTING
        date1                 = '20071122'
        time1                 = '000001'
        date2                 = '20070905'
        time2                 = '000001'
    IMPORTING
       DATEDIFF               = DATEDIFF
    EXCEPTIONS
       INVALID_DATETIME       = 1
       OTHERS                 = 2.
    Greetings,
    Blag.

  • To find the no of working days b/w given date

    Hi ABAP Experts,
             Here i have one requirement .
             table is tfacs
              in  this table i want to know the no of working days b/w  the given date. Here i have attached my code .pls go through it and do me needful.
    TABLES : tfacs,vbrk.
    DATA: BEGIN OF ty_tfacs OCCURS 0,
            ident TYPE tfacs-ident,
            jahr TYPE tfacs-jahr,
            mon01 TYPE tfacs-mon01,
            mon02 TYPE tfacs-mon02,
            mon03 TYPE tfacs-mon03,
            mon04 TYPE tfacs-mon04,
            mon05 TYPE tfacs-mon05,
            mon06 TYPE tfacs-mon06,
            mon07 TYPE tfacs-mon07,
            mon08 TYPE tfacs-mon08,
            mon09 TYPE tfacs-mon09,
            mon10 TYPE tfacs-mon10,
            mon11 TYPE tfacs-mon11,
            mon12 TYPE tfacs-mon12,
            basis TYPE tfacs-basis,
            fenum TYPE tfacs-fenum,
            wenum TYPE tfacs-wenum,
            load TYPE  tfacs-load,
            string1(31) TYPE c,
            string2(31) TYPE c,
            string3(31) TYPE c,
            string4(31) TYPE c,
            string5(31) TYPE c,
            string6(31) TYPE c,
            string7(31) TYPE c,
            string8(31) TYPE c,
            string9(31) TYPE c,
            string10(31) TYPE c,
            string11(31) TYPE c,
            string12(31) TYPE c,
            uk(31) TYPE c,
            total1 TYPE i,
            total2 TYPE i,
            total3 TYPE i,
            total4 TYPE i,
            total5 TYPE i,
            total6 TYPE i,
            total7 TYPE i,
            total8 TYPE i,
            total9 TYPE i,
            total10 TYPE i,
            total11 TYPE i,
            total12 TYPE i,
            END OF ty_tfacs.
    SELECTION-SCREEN : BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    SELECT-OPTIONS : s_jahr FOR tfacs-jahr MODIF ID b1.
    SELECT-OPTIONS : mon FOR tfacs-mon01  MODIF ID b1.
    SELECT-OPTIONS :  s_month FOR vbrk-erdat MODIF ID b2.
    SELECTION-SCREEN : END OF BLOCK b1.
    SELECTION-SCREEN BEGIN OF BLOCK b WITH FRAME.
    PARAMETERS  r1 RADIOBUTTON GROUP c DEFAULT 'X' USER-COMMAND flag .
    PARAMETERS  r2 RADIOBUTTON GROUP c .
    SELECTION-SCREEN END OF BLOCK b.
             INITIALIZATION
    INITIALIZATION.
    AT SELECTION-SCREEN OUTPUT.
      IF r1 NE space.
        LOOP AT SCREEN.
          IF screen-group1 EQ 'B2'.
            screen-output = 1.
            screen-active = 0.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
      ELSE.
        LOOP AT SCREEN.
          IF screen-group1 EQ 'B1'.
            screen-output = 1.
            screen-active = 0.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
      ENDIF.
              start - of - selection
    start-of-selection.
      IF r1 = 'X'.
        PERFORM get-data.
        PERFORM display-data.
      ENDIF.
    &      form  get-data
           text
      -->  p1        text
      <--  p2        text
    form get-data .
      DATA :  total1  TYPE i.
      SELECT * FROM tfacs INTO TABLE ty_tfacs
                                     WHERE ident EQ 'IN'
                                     AND   jahr IN s_jahr.
      LOOP AT  ty_tfacs WHERE ident = 'IN'.
        IF sy-subrc EQ 0.
          PERFORM get_string USING ty_tfacs-string1
                                   ty_tfacs-mon01
                                   ty_tfacs-total1.
          PERFORM get_string USING ty_tfacs-string2
                                    ty_tfacs-mon02
                                    ty_tfacs-total2.
          PERFORM get_string USING ty_tfacs-string3
                                   ty_tfacs-mon03
                                   ty_tfacs-total3.
          PERFORM get_string USING ty_tfacs-string4
                                         ty_tfacs-mon04
                                         ty_tfacs-total4.
          PERFORM get_string USING ty_tfacs-string5
                                         ty_tfacs-mon05
                                         ty_tfacs-total5.
          PERFORM get_string USING ty_tfacs-string6
                                         ty_tfacs-mon06
                                         ty_tfacs-total6.
          PERFORM get_string USING ty_tfacs-string7
                                         ty_tfacs-mon07
                                         ty_tfacs-total7.
          PERFORM get_string USING ty_tfacs-string8
                                         ty_tfacs-mon08
                                         ty_tfacs-total8.
          PERFORM get_string USING ty_tfacs-string9
                                         ty_tfacs-mon09
                                         ty_tfacs-total9.
          PERFORM get_string USING ty_tfacs-string10
                                         ty_tfacs-mon10
                                         ty_tfacs-total10.
          PERFORM get_string USING ty_tfacs-string11
                                         ty_tfacs-mon11
                                         ty_tfacs-total11.
          PERFORM get_string USING ty_tfacs-string12
                                         ty_tfacs-mon12
                                         ty_tfacs-total12.
        ENDIF.
        ty_tfacs-uk = ty_tfacs-total1 + ty_tfacs-total2
                      + ty_tfacs-total3 + ty_tfacs-total4
                      + ty_tfacs-total5 + ty_tfacs-total6
                      + ty_tfacs-total7 + ty_tfacs-total8
                      + ty_tfacs-total9 + ty_tfacs-total10
                      + ty_tfacs-total11 + ty_tfacs-total12.
        MODIFY  ty_tfacs TRANSPORTING  total1 total2 total3
                                       total4 total5 total6
                                       total7 total8 total9
                                       total10 total11 total12
                                       uk.
      ENDLOOP.
    PERFORM write1-data USING 'COU' 'YEAR' 'MONTH01'
                               'MONTH02' 'MONTH03' 'MONTH04'
                               'MONTH05' 'MONTH06' 'MONTH07'
                               'MONTH08' 'MONTH09' 'MONTH10'
                               'MONTH11' 'MONTH12' 'TOTAL WDAYS' .
    LOOP AT ty_tfacs.
       PERFORM write1-data USING ty_tfacs-ident ty_tfacs-jahr
                                 ty_tfacs-total1 ty_tfacs-total2
                                 ty_tfacs-total3 ty_tfacs-total4
                                 ty_tfacs-total5 ty_tfacs-total6
                                 ty_tfacs-total7 ty_tfacs-total8
                                 ty_tfacs-total9 ty_tfacs-total10
                                 ty_tfacs-total11 ty_tfacs-total12
                                 ty_tfacs-uk.
    ENDLOOP.
    ENDFORM.                    " get-data
    TOP-OF-PAGE.
      FORMAT COLOR 5 ON.
      WRITE :/10 'COUNTRY',
              20 'YEARS',
              35 'MON01',
              45 'MON02',
              55 'MON03',
              65 'MON04',
              75 'MON05',
              85 'MON06',
              95 'MON07',
              105 'MON08',
              115 'MON09',
              125 'MON10',
              135 'MON11',
              145 'MON12',
              170 'total wdays'.
      FORMAT COLOR OFF.
      WRITE :/ SY-ULINE.
    *&      Form  display-data
          text
    -->  p1        text
    <--  p2        text
    FORM display-data .
      LOOP AT ty_tfacs.
        WRITE :/10 ty_tfacs-ident,
                20 ty_tfacs-jahr,
                30 ty_tfacs-total1,
                40 ty_tfacs-total2,
                50 ty_tfacs-total3,
                60 ty_tfacs-total4,
                70 ty_tfacs-total5,
                80 ty_tfacs-total6,
                90 ty_tfacs-total7,
               100 ty_tfacs-total8,
               110 ty_tfacs-total9,
               120 ty_tfacs-total10,
               130 ty_tfacs-total11,
               140 ty_tfacs-total12,
               150 ty_tfacs-uk.
      ENDLOOP.
    ENDFORM.                    " display-data
    *&      form  get_string
          text
         -->p_0250   text
         -->p_0251   text
         -->p_0252   text
    form get_string  using    p_0250   " month
                              p_0251   " string
                              p_0252.  " total
    p_0250 = p_0251.  " move month to string
    TRANSLATE p_0250 USING '0 ' . " translate
    CONDENSE p_0250  NO-GAPS.     " condense
    p_0252 = STRLEN( p_0250 ).    " pass length of string to total
    ENDFORM.                    " get_string
    ***&      Form  write1-data
          text
         -->P_0306   text
         -->P_0307   text
         -->P_0308   text
         -->P_0309   text
         -->P_0310   text
         -->P_0311   text
         -->P_0312   text
         -->P_0313   text
         -->P_0314   text
         -->P_0315   text
         -->P_0316   text
         -->P_0317   text
         -->P_0318   text
         -->P_0319   text
         -->P_0320   text
    *form write1-data  using    p_0306
                              p_0307
                              p_0308
                              p_0309
                              p_0310
                              p_0311
                              p_0312
                              p_0313
                              p_0314
                              p_0315
                              p_0316
                              p_0317
                              p_0318
                              p_0319
                              p_0320.
    *WRITE :/ p_0306,
            p_0307,
            p_0308 left-justified,
            p_0309 left-justified,
            p_0310 left-justified,
            p_0311 left-justified,
            p_0312 left-justified,
            p_0313 left-justified,
            p_0314 left-justified,
            p_0315 left-justified,
            p_0316 left-justified,
            p_0317 left-justified,
            p_0318 left-justified,
            p_0319 left-justified,
            p_0320 left-justified.
    *ENDFORM. " write1-data
    from this report what i am getting is year and its 12 months but my requirement is i will give date using select options and i should get the total no of  working days in b/w this date.

    Use the following code to find no of working days b/w given date. Use the correct factory_calendar_id in the function module. L_DAYS will display the required result:
    PARAMETERS: p_date1 TYPE sydatum,
               p_date2 TYPE sydatum.
    DATA: date1        LIKE scal-date,
         date2        LIKE scal-date,
         correction   LIKE scal-indicator,
         calendar     LIKE scal-fcalid,
         factorydate1  LIKE scal-facdate,
         workday1      LIKE scal-indicator,
         factorydate2  LIKE scal-facdate,
         workday2      LIKE scal-indicator,
         l_days TYPE scal-facdate.
    CALL FUNCTION 'DATE_CONVERT_TO_FACTORYDATE'
      EXPORTING
        date                       = p_date1
        correct_option             = '+'
        factory_calendar_id        = 'US'
      IMPORTING
        date                       = date1
        factorydate                = factorydate1
        workingday_indicator       = workday1
      EXCEPTIONS
        correct_option_invalid     = 1
        date_after_range           = 2
        date_before_range          = 3
        date_invalid               = 4
        factory_calendar_not_found = 5.
    IF sy-subrc = 0.
      CALL FUNCTION 'DATE_CONVERT_TO_FACTORYDATE'
        EXPORTING
          date                       = p_date2
          correct_option             = '+'
          factory_calendar_id        = 'US'
        IMPORTING
          date                       = date2
          factorydate                = factorydate2
          workingday_indicator       = workday2
        EXCEPTIONS
          correct_option_invalid     = 1
          date_after_range           = 2
          date_before_range          = 3
          date_invalid               = 4
          factory_calendar_not_found = 5.
      IF sy-subrc = 0.
        l_days = factorydate2 - factorydate1.
        WRITE: / l_days.
      ENDIF.
    ENDIF.

  • How to find particular date lies in between two given dates

    hi,
    i have a problem. i have to find if particular day lies in between two given dates.
    example two dates are joindate and expirydate.
    1.joindate is 1/03/2007
    expdate is 1/03/2008
    now i have to find if 29 feb is in between this joindate and expirydate.
    if any1 has ny idea please reply asap.
    thanks.

    The Date class has a before() and after() method you can use to compare Date objects.

  • Stock report with value and qauntity for given date not month wise

    Hi gems,
    can any body give me the standard report for Stock value and qauntity for given date not month wise at storage location level

    Hi
    check the report S_P00_07000139 with the option inventory and raw material report- detail and selection date (from, to date same). List will give opening & closing balances with goods movment and their values.
    Thanks

  • Stock of a material as on given date

    Hi all,
        Is there any function module or any BAPI to calculate the opening and closing stock of a material as on the given date, based on which a customizing report is to be developed.. There was a Transaction MB5B to know the as on date stock, but it's taking longer time to use it in customizing report.Please let me know if any BAPI or any F.module is there to find the stock of a material as on given date.
    Thanks in advance.
    Edited by: Jaya on Apr 23, 2009 9:15 AM

    Hi,
    Try to develop a report using the logic of MB5B report and minimize the selection criteria
    Regards,
    Vikas

  • How to get start date of the period for a given date from cube

    I have a situation where i need to find the start day of the period for a given date. is there a way to know that. i want to use that in my report. i enter the date from my report(i have date parameter), depends on the date, i want to display the start day
    of the period. how can i write expression for that in my report?
    ram

    Hi ramprasad74,
    According to your description, you are using Analysis Services as a data source for the report, the cube has hierarchy: Fyear, FQuarter, FPeriod, fweek, Fdate. You want to add a date parameter to the report, after you changed value of the parameter, the
    report will return the first day of FPeriod.
    To achieve your goal, we need to add a parameter to the report, then use the parameter in mdx query. For detail information, please refer to the following steps:
    In the Report Data pane, right-click on a dataset created from a SQL Server Analysis Services data source type, and then click Query. The MDX query designer opens in Design mode.
    On the toolbar, click Design to toggle to Query mode.
    On the MDX query designer toolbar, click Query Parameters symbol. The Query Parameters dialog box opens.
    In the Parameter column, click <Enter Parameter>, and then type the name of a parameter.
    In the Dimension column, choose a value from the drop-down list.
    In the Hierarchy column, choose a value from the drop-down list.
    In the Default column, from the drop-down list, select a single value.
    Click OK. 
    In query designer dialog box, type the mdx query like below:
    with member [Measures].[FirstChild]
    as
    [Date].[Fiscal].currentmember.parent.firstchild.name
    select {[Measures].[FirstChild]} on 0,
    [Date].[Fiscal].[Date].members on 1
    from
    ( SELECT ( STRTOSET(@ParameterName, CONSTRAINED) ) on 0
    from
    [Cube]
    Here are relevant threads you can reference:
    https://social.msdn.microsoft.com/forums/sqlserver/en-US/c7146ac3-40ea-4d53-b321-c707aebbd405/how-to-pass-date-parameter-to-mdx-query
    https://social.msdn.microsoft.com/forums/sqlserver/en-US/fd12a865-bc90-4a65-af42-ce38a8cfa29b/pass-date-time-parameter-to-mdx-query-ssrs
    If you have any more questions, please feel free to ask.
    Thanks,
    Wendy Fu
    If you have any feedback on our support, please click
    here.

  • Get the date of a particular week day from given date

    I have a given date.
    from that date i want to get the date of sunday of that week
    wat is the best possible way to do the same.
    for eg:
    if i am given 03/11/2007 which is a saturday
    i want to get 27/10/2007 which is the sunday which falls in the same week as of 03/11/2007
    can anybody please help.

    hi,
    Here I am posting code for your requirement.
    Here I am hard coding the date value.
    import java.util.*;
    public class DateTest{
         public static void main(String ar[]){
              Calendar calendar =new GregorianCalendar(2007,7,4);
              System.out.println("DAY_OF_WEEK: " + calendar.get(Calendar.DAY_OF_WEEK));
              calendar.set(2007,7,4-calendar.get(Calendar.DAY_OF_WEEK)+1);
              System.out.println("DAY_OF_MONTH: " + calendar.get(Calendar.DAY_OF_MONTH));
              System.out.println("MONTH: " + calendar.get(Calendar.MONTH));
    }

  • Error while connecting to an OData Feed from Excel 2013 PowerPivot . Error: Failed to connect to the server. Reason: The payload kind 'BinaryValue' of the given data feed is not supported

    I am trying to connect to a Odata Data feed from Excel 2013 Power Pivot
    The datasource is in sharepoint site eg: https://sitename/Shared%20Documents/datafeed.atomsvc
    getting below error
    Error message:
    Failed to connect to the server. Reason: The payload kind 'BinaryValue' of the given data feed is not supported.
    ============================
    Call Stack:
    ============================
       at Microsoft.Data.DataFeedClient.DataFeedODataReader.ValidatePayloadKind(ODataPayloadKind payloadKind, ODataMessageReader odataMessageReader)
       at Microsoft.Data.DataFeedClient.DataFeedODataReader.InterceptODataException(Action action)
       at Microsoft.Data.DataFeedClient.DataFeedODataReader..ctor(IODataResponseMessage responseMessage, Int64 maxReceivedMessageSize)
       at Microsoft.Data.DataFeedClient.DataFeedODataReader.CreateReader(IWebResponse webResponse, Int64 maxReceivedMessageSize, Boolean applySlashUpdatingBaseUriResolver)
       at Microsoft.Data.DataFeedClient.ODataHelper.GetCollectionsFromServiceDocumentUrl(Uri serviceDocumentUrl, DataFeedConnection connection)
       at Microsoft.Data.DataFeedClient.DataFeedConnection.Open()
       at Microsoft.AnalysisServices.BackEnd.RelationalDataSourceConnection.InitializeConnectionObject(String connectionIdentifier)
       at Microsoft.AnalysisServices.BackEnd.RelationalDataSourceConnection.InitializeConnectionObject(String connectionIdentifier)
       at Microsoft.AnalysisServices.BackEnd.RelationalDataSourceConnection.Open(String& connectionIdentifier)
       at Microsoft.AnalysisServices.BackEnd.RelationalDataSourceConnection.Open()
       at Microsoft.AnalysisServices.Common.DataSourceBasic.ClickTestConnection(Object progressControl)
    Appreciate suggestions/answers
    NOTE: The error is showing only while using Excel 2013 powerpivot
    its working good with Excel 2010 powerpivot

    Anita,
    Please look into using Power Query to use OData as a source in Power Pivot.
    Thanks!
    Ed Price, Power BI & SQL Server Customer Program Manager (Blog,
    Small Basic,
    Wiki Ninjas,
    Wiki)
    Answer an interesting question?
    Create a wiki article about it!

  • How to get the date of first day of a week for a given date

    Hi gurus
    can any one say me how to get the date of first day(date of Sunday) of a week for a given date in a BW transformations. For example for 02/23/2012 in source i need to get 02/19/2012(Sunday`s date) date in the result. I can get that start date of a week using  BWSO_DATE_GET_FIRST_WEEKDAY function module. But this function module retrieves me the  start date as weeks monday(02/20/2012) date. But i need sundays(02/19/2012) date as the start date. So it would be really great if anyone sends me the solution.
    Thanks
    Rav

    Hi,
    The simplest way would be to subtract 1 from the date date which you are already getting in transformation routine, but instead of doing that subtraction manually which might need bit of errort, you can simply use another FM to subtract 1 from given date.
    RP_CALC_DATE_IN_INTERVAL
    Regards,
    Durgesh.

  • HT2513 iCal string of events repeat and end on a given date?

    Is there a way to have any given string of events repeat and end on a given date?
    Example, I have a different training regiment for each day leading up to an event/date and then will have the same training regiment again leading up to another event. I want each day's training regiment to show up as an event per day... but don't want to have to post each days repeat string of training prior to each event... and they don't nessecarily repeat monlthy or regularly... I want to set an end date and all the training fill in from that date backwards. Is this possible??

    Does this work any better? New-jobtrigger requires a datetime object.
    $csv6=Import-Csv D:\Lzero\Coll_Schd\Dependent_List.csv
    foreach($cs in $csv6)
    {$sys=$cs.CI
    [datetime] $schd=$cs.RebootSchedule
    $user="Domain\username"
    $paswd=ConvertTo-SecureString -String "P@ssWord" -AsPlainText -Force
    $Credential=New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $user,$paswd
    Register-ScheduledJob -Name System_Restart -ScriptBlock {
    Restart-Computer -ComputerName $sys -Force -wait} -Trigger (New-JobTrigger -At $schd -Once) -ScheduledJobOption (New-ScheduledJobOption -RunElevated) -Credential $Credential

Maybe you are looking for

  • Itunes Match Won't Recognizing My Apple ID

    ITunes match is not recognizing my Id, its saying I already have an Id registered with my computer, but I didn't . And I have waited the 90 days and it still is saying it. Is it because I got a new computer? Is there a way to delete the error and rep

  • Need to have a form to enter data and then send data to database

    I'm looking for assistance with a form created; the end user will complete the form and then press the submit button to email it. Next I need to import that data to either a database or excel spreadsheet.

  • K8NGM2-FID Stability Issues

    Major Stability Issues.  Have yet to install windows successfully.  Tried every bios setting imaginal.  Tried dual channel and single channel memory cofigurations in every memory slot.  When windows tries to install, the system will spontaneously res

  • Syncing photos with my computer

    When I sync photos from my computer to my phone it copies all the folders and their photos and it also creates a separate "photo library" with duplicates of all the photos. How can I stop this from happening?

  • No local files in gnome-documents

    Hi, my installation is up-to-date. Gnome-documents displays all my google drive files, but it doesn't find local files. I have xdg-user-dirs installed and already tried xdg-user-dirs-update followed by tracker-control -rs. My XDG_DOCUMENTS_DIR in .co