Question regarding the date in MARC for a daily movement report

Hi,
I have a requirement, where i need to create a report, based on the selection screen parameters for <u>purchasing group</u> and <u>date</u> (the default is 1 minus the current date.)
The report is used to view the daily movement, relating to the selected purchasing group and date.
Where and how do i find entries for that specific date? What tables and field or fields do i use?
Points will be rewarded and all help will be greatly appreciated.
Thank You,
John

See the below example code :
REPORT ZQA_MOVEMENT_ANALYSIS no standard page heading.
*>>> ELEMENTS COPIED FROM REPORT BALVHT01 .
ALV
TYPE-POOLS: SLIS.
Includes
INCLUDE .
tables: mkpf, mseg, marc, mara, makt, mard.
DATA =============================================================== *
DATA:       G_BOXNAM TYPE SLIS_FIELDNAME VALUE  'BOX',
            G_EXPANDNAME TYPE SLIS_FIELDNAME VALUE  'EXPAND',
            P_F2CODE LIKE SY-UCOMM       VALUE  '&ETA',
            P_LIGNAM TYPE SLIS_FIELDNAME VALUE  'LIGHTS',
            G_SAVE(1) TYPE C,
            G_TABNAME_HEADER TYPE SLIS_TABNAME,
            G_TABNAME_ITEM   TYPE SLIS_TABNAME,
          g_default(1) type c,
            G_EXIT(1) TYPE C,
            GX_VARIANT LIKE DISVARIANT,
            G_VARIANT LIKE DISVARIANT.
CONSTANTS:
GC_FORMNAME_TOP_OF_PAGE TYPE SLIS_FORMNAME VALUE 'TOP_OF_PAGE',
GC_FORMNAME_ITEM_EXPAND TYPE SLIS_FORMNAME VALUE 'ITEM_EXPAND',
GC_FORMNAME_user_command type slis_formname value slis_ev_user_command.
DATA: GT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
      GS_LAYOUT   TYPE SLIS_LAYOUT_ALV,
      GS_KEYINFO  TYPE SLIS_KEYINFO_ALV,
      GT_SORT     TYPE SLIS_T_SORTINFO_ALV,
      GT_SP_GROUP TYPE SLIS_T_SP_GROUP_ALV,
      GT_EVENTS   TYPE SLIS_T_EVENT.
DATA: G_REPID LIKE SY-REPID.
DATA: GT_LIST_TOP_OF_PAGE TYPE SLIS_T_LISTHEADER.
data: begin of i_movement occurs 0,
        matnr   like mseg-matnr,
        bwart   like mseg-bwart,
        budat   like mkpf-budat,
        mblnr   like mseg-mblnr,
        gjahr   like mseg-gjahr,
        shkzg   like mseg-shkzg,
        menge   like mseg-menge,
        meins   like mseg-meins,
      end of i_movement.
data: begin of i_mat occurs 0,
        matnr   like mara-matnr,
        maktx   like makt-maktx,
        labst   like mard-labst,
        meins   like mara-meins,
      end of i_mat.
data: begin of i_output occurs 0.
        include structure ZFD_MOVEMENT_ANALYSIS.
data:  end of i_output.
data i_popuptext like popuptext occurs 2 with header line.
data: v_matnr like mara-matnr.
data: x_movement  like i_movement.
SELECTION-SCREEN --------------------------------------------------- *
SELECTION-SCREEN BEGIN OF BLOCK period WITH FRAME TITLE text-001.
select-options: so_budat   for mkpf-budat obligatory no-extension.
SELECTION-SCREEN END OF BLOCK period.
SELECTION-SCREEN BEGIN OF BLOCK org WITH FRAME TITLE text-002.
parameters: p_werks   like marc-werks obligatory default '1000',
            p_lgort    like mard-lgort obligatory default '1000'.
select-options: so_matnr   for mseg-matnr,
                so_dept    for marc-zzdept,
                so_kostl   for mseg-kostl,
                so_ekgrp   for marc-ekgrp.
SELECTION-SCREEN END OF BLOCK org.
SELECTION-SCREEN SKIP 1.
Variant
SELECTION-SCREEN BEGIN OF BLOCK 0 WITH FRAME TITLE TEXT-P01.
PARAMETERS: P_VARI LIKE DISVARIANT-VARIANT.
SELECTION-SCREEN END OF BLOCK 0.
INITITALIZATION ==================================================== *
INITIALIZATION.
  G_REPID = SY-REPID.
  G_TABNAME_ITEM   = 'I_OUTPUT'.
define keyinfo
  CLEAR GS_KEYINFO.
  GS_KEYINFO-ITEM01   = 'MATNR'.
  PERFORM E01_FIELDCAT_INIT  USING GT_FIELDCAT[].
  PERFORM E03_EVENTTAB_BUILD USING GT_EVENTS[].
  PERFORM E04_COMMENT_BUILD  USING GT_LIST_TOP_OF_PAGE[].
  PERFORM E06_T_SORT_BUILD   USING GT_SORT[].
  PERFORM E07_SP_GROUP_BUILD USING GT_SP_GROUP[].
Set Options: save variants userspecific or general
  G_SAVE = 'A'.
  PERFORM VARIANT_INIT.
Get default variant
  GX_VARIANT = G_VARIANT.
  CALL FUNCTION 'REUSE_ALV_VARIANT_DEFAULT_GET'
       EXPORTING
            I_SAVE     = G_SAVE
       CHANGING
            CS_VARIANT = GX_VARIANT
       EXCEPTIONS
            NOT_FOUND  = 2.
  IF SY-SUBRC = 0.
    P_VARI = GX_VARIANT-VARIANT.
  ENDIF.
AT SELECTION-SCREEN ================================================ *
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_VARI.
  PERFORM F4_FOR_VARIANT.
PAI
AT SELECTION-SCREEN.
  PERFORM PAI_OF_SELECTION_SCREEN.
START-OF-SELECTION ================================================= *
start-of-selection.
  perform check_background_processing.
  PERFORM E05_LAYOUT_BUILD USING GS_LAYOUT.     "wg. Parameters
  perform get_data.
  perform build_report.
  perform write_report.
AT LINE SELECTION ================================================== *
at line-selection.
  if sy-lsind = 1.
    format intensified off.
    if not i_output-matnr is initial.
      v_matnr = i_output-matnr.
      loop at i_movement where matnr = i_output-matnr.
        write: / i_movement-mblnr hotspot on,
                 i_movement-bwart,
                 i_movement-budat,
                 i_movement-shkzg.
        if i_movement-shkzg = 'H'.
          format color col_negative.
        else.
          format color col_positive.
        endif.
        write:     i_movement-menge,
                   i_movement-meins.
        format color off.
        hide: i_movement-mblnr, i_movement-gjahr.
      endloop.
      clear i_movement.
    endif.
  elseif sy-lsind = 2.
    set parameter id 'MBN' field i_movement-mblnr.
    set parameter id 'MJA' field i_movement-gjahr.
    call transaction 'MB03' and skip first screen.
  endif.
==================================================================== *
top-of-page.
  perform top_of_page.
top-of-page during line-selection.
  read table i_mat with key matnr = i_output-matnr.
  write: i_output-matnr,
         i_mat-maktx,
         so_budat-low, ' to ', so_budat-high.
  uline.
  clear: i_mat, i_output.
*&      Form  write_report
      text
-->  p1        text
<--  p2        text
FORM write_report.
Call ABAP/4 List Viewer
  CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
    I_INTERFACE_CHECK              = ' '
    I_BYPASSING_BUFFER             =
    I_BUFFER_ACTIVE                = ' '
      I_CALLBACK_PROGRAM             = g_repid
    I_CALLBACK_PF_STATUS_SET       = ' '
    I_CALLBACK_USER_COMMAND        = ' '
    I_STRUCTURE_NAME               =
      IS_LAYOUT                      = gs_layout
      IT_FIELDCAT                    = gt_fieldcat[]
    IT_EXCLUDING                   =
      IT_SPECIAL_GROUPS              = gt_sp_group[]
      IT_SORT                        = gt_sort[]
    IT_FILTER                      =
    IS_SEL_HIDE                    =
    I_DEFAULT                      = 'X'
      I_SAVE                         = g_save
      IS_VARIANT                     = g_variant
      IT_EVENTS                      = gt_events[]
    IT_EVENT_EXIT                  =
    IS_PRINT                       =
    IS_REPREP_ID                   =
    I_SCREEN_START_COLUMN          = 0
    I_SCREEN_START_LINE            = 0
    I_SCREEN_END_COLUMN            = 0
    I_SCREEN_END_LINE              = 0
  IMPORTING
    E_EXIT_CAUSED_BY_CALLER        =
    ES_EXIT_CAUSED_BY_USER         =
    TABLES
      T_OUTTAB                       = i_output
    EXCEPTIONS
      PROGRAM_ERROR                  = 1
      OTHERS                         = 2
  IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.
ENDFORM.                    " write_report
*&      Form  get_data
      text
-->  p1        text
<--  p2        text
FORM get_data.
  if so_dept[]    is initial and
     so_matnr[]   is initial and
     so_kostl[]   is initial and
     so_ekgrp[]   is initial.
    i_popuptext-text = 'Please choose a department, material number,'.
    append i_popuptext.
    i_popuptext-text = 'cost center or purchasing group'.
    append i_popuptext.
    CALL FUNCTION 'DD_POPUP_WITH_INFOTEXT'
      EXPORTING
        TITEL              = 'Please Note'
        START_COLUMN       = 1
        START_ROW          = 1
        END_COLUMN         = 5
        END_ROW            = 3
      INFOFLAG           = ' '
    IMPORTING
      ANSWER             =
      TABLES
        LINES          = i_popuptext.
  Stop execution until user enters a purch group or dept.
    stop.
  endif.
get all materials matching selection criteria - exclude finished
materials
  select kmatnr kmaktx labst meins
  from ( ( ( marc as c inner join makt as k
           on cmatnr = kmatnr ) INNER JOIN mard as d
           on cmatnr = dmatnr ) INNER JOIN mara as a
           on cmatnr = amatnr )
  into table i_mat
  where c~matnr in so_matnr   and
        c~ekgrp in so_ekgrp   and
        c~zzdept in so_dept   and
        c~werks  = p_werks    and
        d~werks  = p_werks    and
        k~spras  = 'E'        and
        d~lgort  = p_lgort
  order by k~matnr.
  if sy-subrc = 0.
    read table so_budat index 1.
    loop at i_mat.
    get all material movements for all materials identified since
    start date on date interval selected by user
      select matnr bwart budat bmblnr bgjahr shkzg menge meins
      appending table i_movement
      from (  mseg as b INNER JOIN mkpf as a
            ON bmblnr = amblnr AND
               bmjahr = amjahr )
      where b~matnr = i_mat-matnr and
            a~budat >= so_budat-low.
    endloop.
  endif.
ENDFORM.                    " get_data
*&      Form  build_report
      text
-->  p1        text
<--  p2        text
FORM build_report.
  data: x_movement        like i_movement,
        v_processed_inv   like mseg-menge.
  sort i_movement by matnr ascending
                     budat descending.
  loop at i_movement.
  if movement after end of period specified, use movement to work
  backwards to inventory at end of selected period end date
    if i_movement-budat > so_budat-high.
      if i_movement-shkzg = 'H'.
        add i_movement-menge to i_output-ending_inv.
      else.
        subtract i_movement-menge from i_output-ending_inv.
      endif.
    endif.
  compute inventory at beginning of period
    if i_movement-shkzg = 'H'.
      add i_movement-menge to i_output-begin_inv.
    else.
      subtract i_movement-menge from i_output-begin_inv.
    endif.
  if movement in the time period specified, summarize movements by
  type
    if i_movement-budat >= so_budat-low and
       i_movement-budat <= so_budat-high.
      if i_movement-bwart+0(1) = '1'.
        if i_movement-shkzg = 'S'.
          add i_movement-menge to i_output-purchased_inv.
        else.
          subtract i_movement-menge from i_output-purchased_inv.
        endif.
      elseif i_movement-bwart+0(1) = '2'.
        if i_movement-shkzg = 'S'.
          add i_movement-menge to i_output-transferred_inv.
        else.
          subtract i_movement-menge from i_output-transferred_inv.
        endif.
      elseif i_movement-bwart+0(1) = '4'.
        if i_movement-shkzg = 'S'.
          add i_movement-menge to i_output-transferred_inv.
        else.
          subtract i_movement-menge from i_output-transferred_inv.
        endif.
      elseif i_movement-bwart+0(2) = '55'.
        if i_movement-shkzg = 'S'.
          add i_movement-menge to i_output-scrapped_inv.
        else.
          subtract i_movement-menge from i_output-scrapped_inv.
        endif.
      elseif i_movement-bwart+0(1) = '6'.
        if i_movement-shkzg = 'S'.
          add i_movement-menge to i_output-sold_inv.
        else.
          subtract i_movement-menge from i_output-sold_inv.
        endif.
      elseif i_movement-bwart+0(1) = '7'.
        if i_movement-shkzg = 'S'.
          add i_movement-menge to i_output-cycled_inv.
        else.
          subtract i_movement-menge from i_output-cycled_inv.
        endif.
      elseif i_movement-bwart+0(2) = '96'.
        if i_movement-shkzg = 'S'.
          add i_movement-menge to i_output-recovered_inv.
        else.
          subtract i_movement-menge from i_output-recovered_inv.
        endif.
      else.
        if i_movement-shkzg = 'S'.
          add i_movement-menge to i_output-other.
        else.
          subtract i_movement-menge from i_output-other.
        endif.
      endif.
    endif.
  Summarize data for material number and add to output list
    x_movement = i_movement.
    at end of matnr.
      clear i_mat.
      read table i_mat with key matnr = i_movement-matnr.
      i_output-maktx = i_mat-maktx.
    inventory at end of period = current inventory + changes since end
    of period
      add i_mat-labst to i_output-ending_inv.
    inventory at begin of period = ending inventory + changes in
    interval
      add i_mat-labst to i_output-begin_inv.
    build percentages for types of movements in period - the only
    reason this data needs to be stored rather than computed on the
    fly is for sorting of data
      v_processed_inv = ( i_output-begin_inv - i_output-ending_inv )
                        + i_output-purchased_inv.
      if v_processed_inv <> 0.
        i_output-percent_sold =
              ( i_output-sold_inv / v_processed_inv ) * 100 * -1.
        i_output-percent_scrapped =
              ( i_output-scrapped_inv / v_processed_inv ) * 100 * -1.
        i_output-percent_transferred =
              ( i_output-transferred_inv / v_processed_inv ) * 100 * -1.
        i_output-percent_cycled =
              ( i_output-cycled_inv / v_processed_inv ) * 100 * -1.
        i_output-percent_recov =
              ( i_output-recovered_inv / v_processed_inv ) * 100 * -1.
        i_output-other =
              ( i_output-other / v_processed_inv ) * 100 * -1.
      endif.
    record material number
      move i_movement-matnr to i_output-matnr.
      i_output-meins = x_movement-meins.
      append i_output.
      clear i_output.
    endat.
  endloop.
  clear i_movement.
ENDFORM.                    " build_report
      FORM E01_FIELDCAT_INIT                                        *
-->  E01_LT_FIELDCAT                                               *
FORM E01_FIELDCAT_INIT USING E01_LT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.
  DATA: LS_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
  CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
       EXPORTING
          I_PROGRAM_NAME         =
            I_INTERNAL_TABNAME     = G_TABNAME_ITEM
            I_STRUCTURE_NAME       = 'ZFD_MOVEMENT_ANALYSIS'
          I_CLIENT_NEVER_DISPLAY = 'X'
            I_BYPASSING_BUFFER     = 'X'
       CHANGING
            CT_FIELDCAT            = E01_LT_FIELDCAT[].
ENDFORM.
      FORM E03_EVENTTAB_BUILD                                       *
-->  E03_LT_EVENTS                                                 *
FORM E03_EVENTTAB_BUILD USING E03_LT_EVENTS TYPE SLIS_T_EVENT.
  DATA: LS_EVENT TYPE SLIS_ALV_EVENT.
  CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
       EXPORTING
            I_LIST_TYPE = 1
       IMPORTING
            ET_EVENTS   = E03_LT_EVENTS.
tell program which form to call for top of page event
  READ TABLE E03_LT_EVENTS WITH KEY NAME = SLIS_EV_TOP_OF_PAGE
                           INTO LS_EVENT.
  IF SY-SUBRC = 0.
    MOVE GC_FORMNAME_TOP_OF_PAGE TO LS_EVENT-FORM.
    APPEND LS_EVENT TO E03_LT_EVENTS.
  ENDIF.
tell program which form to call for item expand event
  READ TABLE E03_LT_EVENTS WITH KEY NAME = slis_ev_item_data_expand
                           INTO LS_EVENT.
  IF SY-SUBRC = 0.
    MOVE GC_FORMNAME_ITEM_EXPAND TO LS_EVENT-FORM.
    APPEND LS_EVENT TO E03_LT_EVENTS.
  ENDIF.
ENDFORM.
      FORM E04_COMMENT_BUILD                                        *
-->  E04_LT_TOP_OF_PAGE                                            *
FORM E04_COMMENT_BUILD USING E04_LT_TOP_OF_PAGE TYPE SLIS_T_LISTHEADER.
  DATA: LS_LINE TYPE SLIS_LISTHEADER.
Listenüberschrift: Typ H
  CLEAR LS_LINE.
  LS_LINE-TYP  = 'H'.
LS_LINE-KEY:  not used for this type
  write sy-datum to LS_LINE-INFO.
  APPEND LS_LINE TO E04_LT_TOP_OF_PAGE.
  CLEAR LS_LINE.
  LS_LINE-TYP  = 'H'.
LS_LINE-KEY:  not used for this type
  LS_LINE-INFO = 'FreshDirect Product Reorder Report'.
  APPEND LS_LINE TO E04_LT_TOP_OF_PAGE.
Kopfinfo: Typ S
CLEAR LS_LINE.
LS_LINE-TYP  = 'S'.
LS_LINE-KEY  = TEXT-050.
LS_LINE-INFO = TEXT-010.
APPEND LS_LINE TO E04_LT_TOP_OF_PAGE.
LS_LINE-KEY  = TEXT-051.
APPEND LS_LINE TO E04_LT_TOP_OF_PAGE.
Aktionsinfo: Typ A
CLEAR LS_LINE.
LS_LINE-TYP  = 'A'.
LS_LINE-KEY:  not used for this type
LS_LINE-INFO = TEXT-002.
APPEND LS_LINE TO  E04_LT_TOP_OF_PAGE.
ENDFORM.
      FORM E05_LAYOUT_BUILD                                         *
<->  E05_LS_LAYOUT                                                 *
FORM E05_LAYOUT_BUILD USING E05_LS_LAYOUT TYPE SLIS_LAYOUT_ALV.
  E05_LS_LAYOUT-F2CODE            = P_F2CODE.
  E05_LS_LAYOUT-ZEBRA             = 'X'.
  E05_LS_LAYOUT-colwidth_optimize = 'X'.
ENDFORM.
      FORM E06_T_SORT_BUILD                                         *
-->  E06_LT_SORT                                                   *
FORM E06_T_SORT_BUILD USING E06_LT_SORT TYPE SLIS_T_SORTINFO_ALV.
  DATA: LS_SORT TYPE SLIS_SORTINFO_ALV.
  CLEAR LS_SORT.
  LS_SORT-FIELDNAME = 'MATNR'.
  LS_SORT-TABNAME   = G_TABNAME_ITEM.
  LS_SORT-SPOS      = 1.
  LS_SORT-UP        = 'X'.
  APPEND LS_SORT TO E06_LT_SORT.
ENDFORM.
      FORM E07_SP_GROUP_BUILD                                       *
-->  E07_LT_SP_GROUP                                               *
FORM E07_SP_GROUP_BUILD USING E07_LT_SP_GROUP TYPE SLIS_T_SP_GROUP_ALV.
  DATA: LS_SP_GROUP TYPE SLIS_SP_GROUP_ALV.
  CLEAR  LS_SP_GROUP.
  LS_SP_GROUP-SP_GROUP = 'A'.
  LS_SP_GROUP-TEXT     = TEXT-005.
  APPEND LS_SP_GROUP TO E07_LT_SP_GROUP.
ENDFORM.
      FORM TOP_OF_PAGE                                              *
FORM TOP_OF_PAGE.
  CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
       EXPORTING
            IT_LIST_COMMENTARY = GT_LIST_TOP_OF_PAGE.
              data v_repid like sy-repid.
write: / sy-datum, sy-uzeit,
   100 'FreshDirect Material Movement Type Analysis Report'.
show parameters chosen on selection screen in header
v_repid = sy-repid.
CALL FUNCTION 'Z_WRITE_SELECTION_SCREEN'
      EXPORTING
           REPID            = v_repid
      EXCEPTIONS
           REPORT_NOT_FOUND = 1
           OTHERS           = 2.
write column headings
format color col_heading.
write: /(18) 'Material #',
         (40) 'Description',
         (16) '  Beginning Inv.',
         (16) '       Purchased',
         (16) '  Available Inv.',
         (16) '     Ending Inv.',
         (16) '  Processed Inv.',
         (25) '                     Sold',
         (25) '                 Scrapped',
         (25) '              Transferred',
         (25) '            Cycle Counted',
         (25) '                    Other'.
format color off.
uline /1(278).
ENDFORM.
      FORM F4_FOR_VARIANT                                           *
FORM F4_FOR_VARIANT.
  CALL FUNCTION 'REUSE_ALV_VARIANT_F4'
       EXPORTING
            IS_VARIANT          = G_VARIANT
            I_SAVE              = G_SAVE
            I_TABNAME_HEADER    = G_TABNAME_HEADER
            I_TABNAME_ITEM      = G_TABNAME_ITEM
          it_default_fieldcat =
       IMPORTING
            E_EXIT              = G_EXIT
            ES_VARIANT          = GX_VARIANT
       EXCEPTIONS
            NOT_FOUND = 2.
  IF SY-SUBRC = 2.
    MESSAGE ID SY-MSGID TYPE 'S'      NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ELSE.
    IF G_EXIT = SPACE.
      P_VARI = GX_VARIANT-VARIANT.
    ENDIF.
  ENDIF.
ENDFORM.
*&      Form  PAI_OF_SELECTION_SCREEN
      text
FORM PAI_OF_SELECTION_SCREEN.
  IF NOT P_VARI IS INITIAL.
    MOVE G_VARIANT TO GX_VARIANT.
    MOVE P_VARI TO GX_VARIANT-VARIANT.
    CALL FUNCTION 'REUSE_ALV_VARIANT_EXISTENCE'
         EXPORTING
              I_SAVE     = G_SAVE
         CHANGING
              CS_VARIANT = GX_VARIANT.
    G_VARIANT = GX_VARIANT.
  ELSE.
    PERFORM VARIANT_INIT.
  ENDIF.
ENDFORM.                               " PAI_OF_SELECTION_SCREEN
*&      Form  VARIANT_INIT
      text
-->  p1        text
<--  p2        text
FORM VARIANT_INIT.
  CLEAR G_VARIANT.
  G_VARIANT-REPORT = G_REPID.
ENDFORM.                               " VARIANT_INIT
INCLUDE ZQA_UTILITY_INCLUDE.
***INCLUDE ZQA_UTILITY_INCLUDE .
*&      Form  display_popup_message
      text
-->  p1        text
<--  p2        text
form display_popup_message using x_text1
                                 x_text2.
  data: int_popuptext like popuptext occurs 2 with header line.
  int_popuptext-text = x_text1.
  append int_popuptext.
  int_popuptext-text = x_text2.
  append int_popuptext.
  call function 'DD_POPUP_WITH_INFOTEXT'
    exporting
      titel              = 'Please Note'
      start_column       = 1
      start_row          = 1
      end_column         = 5
      end_row            = 3
    tables
      lines          = int_popuptext.
endform.                    " display_popup_message
*&      Form  upload_data_file
      text
     -->P_int_INPUTDATA  text
form upload_data_file tables      x_inputdata
                      using x_filename like rlgrap-filename.
  clear x_inputdata.
  refresh x_inputdata.
file on UNIX app server
  if x_filename+0(1) = '/'.
    open dataset x_filename for input.
    if sy-subrc <> 0.
      perform display_popup_message using 'Error opening file'
                                  x_filename.
      stop.
    else.
      do.
        read dataset x_filename into x_inputdata.
        if sy-subrc <> 0.
          exit.
        endif.
        append x_inputdata.
        clear x_inputdata.
      enddo.
    endif.
    close dataset x_filename.
  else.
file on local PC of GUI
    call function 'UPLOAD'
      exporting
        filename                      = x_filename
        filetype                      = 'ASC'
      tables
        data_tab                      = x_inputdata
     exceptions
       conversion_error              = 1
       invalid_table_width           = 2
       invalid_type                  = 3
       no_batch                      = 4
       unknown_error                 = 5
       guint_refuse_filetransfer       = 6
       others                        = 7
    if sy-subrc <> 0.
      perform display_popup_message using 'Error opening file'
                                    x_filename.
      stop.
    endif.
  endif.
endform.                    " upload_data_file
*&      Form  check_background_processing
      text
-->  p1        text
<--  p2        text
form check_background_processing.
endform.                    " check_background_processing
Reward Points if it is helpful
Thanks
Seshu

Similar Messages

  • Question regarding the default web template for queries

    Hello,
    I am trying to learn the default web template that is using for queries:
    0QUERY_TEMPLATE_BROADCASTING70
    I see that it's <bi:QUERY value="" /> is empty which is logic since the query will be inserted on runtime. My question is, where in the web template does it say that? I can't see any parameter it expects to get with the query's technical name not at the webtemplate code nor at the URL...
    Roy

    Roy,
    I think you are mixing things. The template you are mentioning is used for queries that are executed from the query designer. It's not a web template as any other one you create for your users. So, this web template has some parts in it's code that works with the query execution. When you run a query, the system takes the query definition (made in QD) and executes it with the web template indicated for the query. This determination is made by the program that is used to run queries. You can try using RSRT transaction to debug and check how this it's done. If you want to change the default web template used by query designer to run the queries, you should do it copying any standard template, like the one you mentioned. If you don't do it, you won't get the information correct.
    Hope this helps.
    Regards,
    Diego

  • Query regarding the data type for fetcing records from multiple ODS tables

    hey guys;
    i have a query regarding the data type for fetcing records from multiple ODS tables.
    if i have 2 table with a same column name then in the datatype under parent row node i cant add 2 nodes with the same name.
    can any one help with some suggestion.

    Hi Mudit,
    One option would be to go as mentioned by Padamja , prefxing the table name to the column name or another would be to use the AS keyoword in your SQL statement.
    AS is used to rename the column name when data is being selected from your DB.
    So, the query  Select ename as empname from emptable will return the data with column name as empname.
    Regards,
    Bhavesh

  • I have just got my iPad2 and very pleased with it. I have a question regarding the monthly (recommended) battery full charge.  Should I let the battery completely die down to nothing at all or would this be bad for my iPad?

    I have just got my iPad2 and am very pleased with it. I have a question regarding the monthly (recommended) battery full charge.  Should I let the battery completely die down to nothing at all before I plug in to recharge or would this complete drain be bad for my iPad?

    It's not bad for it - on this page www.apple.com/batteries/ipad.html it says :
    For proper reporting of the battery’s state of charge, be sure to go through at least one charge cycle per month (charging the battery to 100% and then completely running it down).

  • I have read all the questions regarding the "Can't send photo using iMessage".

    I have read all the questions regarding the "Can't send photo using iMessage". I followed everything and check everything that was in it. It's still the same. I am still not able to send a photo. It started happening last week. It was fine before that. There is no error message.
    It will try to send but it will get stuck just before it sends
    and the red ! will appear with the "Not Delivered" status.
    When i tap on the !, it just says "This iMessage was not delived".
    No other message or photo is sending as the same time as the photo.
    I did reset it, I checked the email address, removed it as well. Turned it off then back on. Signed out and signed back in. Wi-Fi strength is very good. iOS is 6.0.1. I checked for updates, it is up-to-date I also checked a link http://support.apple.com/kb/TS2755. It did not help at all.
    What's wrong?!?!?!?!

    It is not a matter of reconsidering the decision. There are unsolveable technical problems with trying to run a program such as Firefox on Blackberry OS. We would need Blackberry to distribute a tool similar to Android's NDK to run on Blackberries.

  • Question regarding Polling data from database using DB Adapters in BPEL

    Hi,
    I have the following question regarding Polling data from database using DB Adapters in BPEL -
    If I am selecting data from multiple tables/view to ultimately generate hierarchical xml document, is there a way that I specify polling all of these tables/views. Is polling limited only to one table/view?
    Thanks
    Ravi

    Hi Ravi,
    your question seems to have been answered for the question of polling a set of tables with one as the root, and getting back a hierarchical xml representing multiple related tables.
    However you can also poll for changes to both the root table and its related tables. Not sure if this was your question or the one already answered. If the former please check out the sample
    bpel/samples/tutorials/122.DBAdapter/advanced/polling/PollingForChildUpdates
    Thanks
    Steve

  • Question regarding the Transformation activity in BPEL

    Hi,
    I have a question regarding the Transformation activity in BPEL.
    I have a database adapter that uses a PL/SQL API. The API returns two tables of nested objects and it automatically generates a schema for me based on the outputs structure. I need to use the Transformation activity to map both these out parameters to root element in the destination.
    The element in the destination is "unbounded". Please take a look at the following screen shot -
    http://www-apps.us.oracle.com:1100/~rvishnuv/transform1.gif
    From the screen shot, you can notice that I have two XML segments X_TEST_TBL and X_TEST_TBL1 in the source and I have one GLOGXMLElement ("unbounded") in the destination. I need to map each of the source elements to the same destination. Then internally, I will be mapping the elements of X_TEST_TBL to "Location" segment/element and the elements of "X_TEST_TBL1" to "ItemMaster" segment/element. If I try to use "foreach" and map second
    element "X_TEST_TBL1" also GLOGXMLElement using the foreach, I get the following error -
    http://www-apps.us.oracle.com:1100/~rvishnuv/transform1_error.gif
    Let us say my X_TEST_TBL contians two records and X_TEST_TBL1 contains one record. Is there any way that I can use these two out parameters to map to the same destination (GLOGXMLElement) so that my final document contains multiple "GLOGXMLElement"s that represents data from both the output parameters? i.e. there should be in total of three occurances of GLOGXMLelement in the output document such that two occurances correspond to data obtained from X_TEST_TBL and one corresponds to data from X_TEST_TBL1.
    Please let me know if there is any way to achieve this.
    Thanks
    Ravi

    Is the listed $200 credit towards a trade-in on top of the original trade in value of a phone, or the maximum amount?

  • Questions regarding the APEX sample shopping cart

    I am fairly new to APEX development, but had a few questions regarding the sample APEX shopping cart:
    1) is there a way to integrate Google check out payments with the sample APEX shopping cart
    2) is there any way to list a service, that involves monthly recurring payments
    3) is there any other shopping cart that is APEX based that is available
    Thank you,
    Ashok

    Hi Sam,
    i am haveing a deadline monitoring for my shopping cart where remainders are going to generate for first day and the second day, after both the remainders generated and the approver changing the cost center or asset or order at that time, the workflow flow should retrigger and send the approval mail to the new approver, but it is not going to the new approver, so the workflow is not triggering in my case. so i need to restart my workflow again if any changes occurs.
    in the second point my functional guy says that, when the approver changes any text or any date like that it should come for the accept changes, and when he sees the approval preview, only the approval person should be there but not the creator person in the preview and when the creator of the sc accepts the changes it is showing that it is approved by the creator name but he says that it should the approver name not the creator name.
    so can you please help me in this to get the solution.
    thanks in advance

  • How can I select a radio button in a table regarding the data in the cells?

    Hi everyone
    This is the issue: I need to select the RadioButton which is in a table with data related to transfers in the cells next to it, so I need to select the correct radio regarding the data next to it.
    This is the whole process: First I go to the Add Recurring Transfer section and select the parameters of the transfer (Accounts, date, amount, months etc), then with VB code I capture those parameters from the page and store them into Global variables for further usage on my E-tester script.
    Right after that I need to select the radiobutton regarding the data of the transfer that I already created in order to delete it or modify it (Please see Attachment selectradio1.jpg)
    So How can I move along the table and compare each cell with the variables that I created with the transfer information, so when I finish comparing a row cell by cell and if all the comparison match well in that row, I could select the radiobutton of the row.
    Note: Second Attachment selectradio2.jpg shows the source code of the table...If you need more info please let me know
    Could you please help me with this problem?? I'm Kind of frustrated with this issue jejeje

    Here is an example. I uploaded mock html so that you can actually try this code. I think this does exactly what you are asking.
    Private Sub RSWVBAPage_afterPlay()
    Dim tbl As HTMLTable
    Dim tblRow As HTMLTableRow
    Dim tblCell As HTMLTableCell
    Dim strValue As String
    Dim rButton As HTMLInputElement
    ' ******** This would be your global variable. I put this so that values are seperated by a semicolin you can use what ever format works for you.
    strValue = "03/22/2008;03/22/2008;*************1977;*************1977;$25.25;Jan, Jun, Jul, Dec"
    ' Strip out the ; for inner text comparison
    strValue = Replace(strValue, ";", "")
    ' This will get the table but can be modifoed to be more specific
    Set tbl = RSWApp.om.FindElement(, "TABLE")
    ' This loops through all the rows in the table until a match to the strValue is found
    ' then clicks the radio button. Findelements allows you to specify a root element
    ' once the correct root row is found, FindElemets can get the correct radio button
    For Each tblRow In tbl.rows
      If tblRow.innerText = strValue Then
        Set rButton = RSWApp.om.FindElement("account", "INPUT", "NAME", , , tblRow)
         rButton.click
       End If
    Next
    End Sub
    I also uploaded the script I created. You should be able to run it and see how it works.
    This should get you going.

  • When attempting to view the date track history for one employee, errors out

    Hi All
    When I attempt to view the date track history for one employee, it gives errors.
    To get the details, the navigation is :
    1. Search for employee xxxxxx
    2. click on Assignment button
    3. click on Date Track History.
    4. Receive error APP-DT-52554.
    5. Click OK on error message
    6. click on Full History button.
    7. Receive error APP-PAY-06153
    What could be the problem and how to solve this?
    Regards
    Rahman

    Sounds as if there is an inconsistency with the date tracked records. Can you check the records through TOAD or SQL Plus?
    Have alook at MetaLInk article 343070.1 which refers to the second error message.
    Regards
    Tim

  • Errors in the back-end database access module. OLE DB was unable to convert a value to the data type requested for column 5

     
    Hi All,
    I'm still struggling with the same cube and this is my 3rd post and once i fix some thing the other breaks. Please forgive me. When i process my cube i'm getting the error:
    Errors in the back-end database access module. OLE DB was unable to convert a value to the data type requested for column 5.
    My question is when the error says column 5 (is it the column 5 in the DSV?) or is it the column 5 in the DIMENSION list?
    My next question is the DSV Query works perfectly fine , so why this error in cube? This is what i have in the query in DSV.
    Please need help. In the below query both the column 5 (ArEASSIGNED TO VENDOR) in the CUBE and underlying table have the same data type and length VARCHAR(4000). Why is the process failing still?
    SELECT [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[compliancejoin]
    AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_0],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[mowingsector]
    AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_1],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[caseclosedflag]
    AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_2],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[casehasvendorinfo]
    AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_3],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[mowingstatus]
    AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_4],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[assignedtovendor]
    AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_5],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[reassignedtovendor]
    AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_6],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[currentvendor]
    AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_7],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[invoiced]
    AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTSInvoiced0_8],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[invoicedstatus]
    AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_9],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[casecloseddateid]
    AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_10],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[assignedtovendordateid] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_11],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[reassigneddateid] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_12],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[currentassigneddateid] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_13],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[mowingduedateid] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_14],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[vendormoweddateid] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_15],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[captypename] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_16],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[casetype] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTSCaseType0_17],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[casenumbersubgroup] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_18],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[casetownship] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_19],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[casestatus] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTSCaseStatus0_20],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[caseopendateid] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_21],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[casereferredtolegalflag]
    AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_22],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[casemacinitiatedflag] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_23],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[caseconversionstatusdesc]
    AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_24],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[reasonforinvestigation] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_25],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[investigationopendateid]
    AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_26],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[receiveddateid] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_27],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[assigned_department_staff]
    AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_28],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[caseinitiator] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_29],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[vendorinvoiceamount] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_30],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[inspection_result] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_31],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[reason_for_complaint] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_32],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[vendor_action] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_33],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[complaint_source] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_34],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[contractcompliancevendor]
    AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_35],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[invoicedstatusdateid] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_36],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[date_of_complaint_id] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_37],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[date_of_inspection_id] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_38],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[casenumber] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTSCaseNumber0_39],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[parcelnumber] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_40],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[row_index] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTSROW_INDEX0_41]
    FROM (SELECT CASE Isnumeric(
    accela_staging.dbo.fact_highweedsandgrassdetails.vendorinvoiceamount)
    WHEN 1 THEN Cast(
    fact_highweedsandgrassdetails.vendorinvoiceamount AS
    VARCHAR(
    10))
    END AS
    Total_Dollar_Amount,
    fact_highweedsandgrassdetails.casenumber,
    fact_highweedsandgrassdetails.row_index,
    fact_highweedsandgrassdetails.mowingsector,
    fact_highweedsandgrassdetails.caseclosedflag,
    fact_highweedsandgrassdetails.casecloseddateid,
    fact_highweedsandgrassdetails.maccomments,
    fact_highweedsandgrassdetails.lastfeeinvoicedateid,
    fact_highweedsandgrassdetails.casehasvendorinfo,
    fact_highweedsandgrassdetails.mowingstatus,
    fact_highweedsandgrassdetails.receiveddateid,
    fact_highweedsandgrassdetails.assignedtovendordateid,
    fact_highweedsandgrassdetails.assignedtovendor,
    fact_highweedsandgrassdetails.reassigneddateid,
    fact_highweedsandgrassdetails.reassignedtovendor,
    fact_highweedsandgrassdetails.currentvendor,
    fact_highweedsandgrassdetails.currentassigneddateid,
    fact_highweedsandgrassdetails.mowingduedateid,
    fact_highweedsandgrassdetails.vendormoweddateid,
    fact_highweedsandgrassdetails.invoiced,
    fact_highweedsandgrassdetails.invoicedstatus,
    fact_highweedsandgrassdetails.invoicedstatusdateid,
    fact_highweedsandgrassdetails.vendorinvoicenumber,
    fact_highweedsandgrassdetails.vendorcomments,
    fact_casedetails.captypename,
    fact_casedetails.casenumbersubgroup,
    fact_casedetails.casetype,
    fact_casedetails.township AS
    CaseTownship,
    fact_casedetails.casestatus,
    fact_casedetails.caseopendateid,
    fact_casedetails.referredtolegalflag AS
    CaseReferredToLegalFlag,
    fact_casedetails.macinitiatedflag AS
    CaseMACInitiatedFlag,
    fact_casedetails.conversionstatusdesc AS
    CaseConversionStatusDesc,
    fact_casedetails.assignedstaff AS
    CaseAssignedStaff,
    fact_casedetails.completedstaff AS
    CaseCompletedStaff,
    fact_casedetails.closedbystaff AS
    CaseClosedByStaff,
    fact_casedetails.initiator AS
    CaseInitiator,
    fact_casedetails.reasonforinvestigation,
    fact_casedetails.primaryaddress,
    fact_casedetails.parcelnumber,
    Cast(Datediff([day],
    fact_highweedsandgrassdetails.receiveddatetime,
    COALESCE (fact_highweedsandgrassdetails.casecloseddate,
    fact_highweedsandgrassdetails.vendormoweddate,
    fact_highweedsandgrassdetails.recordimportdatetime)) AS
    DECIMAL(6, 2))
    AS
    DaysOpen,
    Cast(Datediff([day],
    fact_highweedsandgrassdetails.receiveddatetime,
    COALESCE
    (fact_highweedsandgrassdetails.vendormoweddate,
    fact_highweedsandgrassdetails.casecloseddate,
    fact_highweedsandgrassdetails.recordimportdatetime)) AS
    NUMERIC(9, 2))
    * 24 AS
    HoursOpenToMow,
    Cast(Datediff([day],
    fact_highweedsandgrassdetails.assignedtovendordate,
    COALESCE
    (fact_highweedsandgrassdetails.vendormoweddate,
    fact_highweedsandgrassdetails.casecloseddate,
    fact_highweedsandgrassdetails.recordimportdatetime)) AS
    NUMERIC(9, 2))
    * 24 AS
    HoursAssignedToMow,
    CASE
    WHEN mowingstatus = 'Mowed'
    OR mowingstatus = 'Closed' THEN 1
    ELSE 0
    END AS
    NumberComplete,
    fact_highweedsandgrassdetails.recordimportdatetime,
    fact_casedetails.macsiebelnumber,
    fact_highweedsandgrassdetails.mowingduedate,
    fact_highweedsandgrassdetails.vendormoweddate,
    fact_highweedsandgrassdetails.lastfeeinvoicedate,
    fact_highweedsandgrassdetails.investigationopendatetime,
    fact_highweedsandgrassdetails.investigationopendate,
    fact_highweedsandgrassdetails.investigationopendateid,
    Cast(Datediff([day],
    fact_highweedsandgrassdetails.investigationopendatetime,
    CASE
    WHEN
    ( vendormoweddatetime IS NOT NULL
    AND vendormoweddatetime <=
    fact_highweedsandgrassdetails.casecloseddate ) THEN
    fact_highweedsandgrassdetails.vendormoweddatetime
    ELSE
    CASE
    WHEN (
    fact_highweedsandgrassdetails.casecloseddate IS
    NOT NULL
    AND fact_highweedsandgrassdetails.casecloseddate
    <=
    fact_highweedsandgrassdetails.recordimportdatetime )
    THEN
    fact_highweedsandgrassdetails.casecloseddate
    ELSE fact_highweedsandgrassdetails.recordimportdatetime
    END
    END) AS NUMERIC(9, 2)) * 24 AS
    AbatementDurationHoursOLD,
    Cast(Datediff([day],
    fact_highweedsandgrassdetails.investigationopendatetime,
    CASE
    WHEN
    COALESCE (vendormoweddatetime,
    fact_highweedsandgrassdetails.casecloseddate) IS
    NOT NULL THEN COALESCE (vendormoweddatetime,
    fact_highweedsandgrassdetails.casecloseddate)
    ELSE
    CASE
    WHEN ( fact_highweedsandgrassdetails.casecloseddate IS NOT NULL
    AND fact_highweedsandgrassdetails.casecloseddate <=
    fact_highweedsandgrassdetails.recordimportdatetime ) THEN
    fact_highweedsandgrassdetails.casecloseddate
    ELSE fact_highweedsandgrassdetails.recordimportdatetime
    END
    END) AS NUMERIC(9, 2)) * 24 AS
    AbatementDurationHours,
    fact_casedetails.assigneddepartment,
    COALESCE (fact_casedetails.assignedstaff, '[null]')
    + '/'
    + COALESCE (fact_casedetails.assigneddepartment, '[null]') AS
    Assigned_Department_Staff,
    fact_highweedsandgrassdetails.casecloseddate,
    fact_highweedsandgrassdetails.receiveddatetime,
    fact_highweedsandgrassdetails.assignedtovendordate,
    fact_highweedsandgrassdetails.vendorinvoiceamount,
    fact_highweedsandgrassdetails.invoicedstatusdate,
    fact_highweedsandgrassdetails.complaint_source,
    fact_highweedsandgrassdetails.inspection_result,
    fact_highweedsandgrassdetails.reason_for_complaint,
    fact_highweedsandgrassdetails.contractcompliancevendor,
    fact_highweedsandgrassdetails.vendor_action,
    fact_highweedsandgrassdetails.date_of_complaint_id,
    fact_highweedsandgrassdetails.date_of_inspection_id,
    CONVERT(INT, Replace(Replace(fact_highweedsandgrassdetails.casenumber,
    'HWG', 0)
    , '-', 0)) AS compliancejoin,
    fact_highweedsandgrassdetails.maccomments AS Expr1,
    dbo.dim_highweedscensustracts.b1_census_tract
    FROM dbo.fact_highweedsandgrassdetails
    INNER JOIN dbo.fact_casedetails
    ON fact_highweedsandgrassdetails.casenumber =
    fact_casedetails.casenumber
    INNER JOIN dbo.dim_highweedscensustracts
    ON fact_highweedsandgrassdetails.casenumber =
    dbo.dim_highweedscensustracts.casenumber
    GROUP BY fact_highweedsandgrassdetails.casenumber,
    fact_highweedsandgrassdetails.row_index,
    fact_highweedsandgrassdetails.mowingsector,
    fact_highweedsandgrassdetails.caseclosedflag,
    fact_highweedsandgrassdetails.casecloseddateid,
    fact_highweedsandgrassdetails.maccomments,
    fact_highweedsandgrassdetails.lastfeeinvoicedateid,
    fact_highweedsandgrassdetails.casehasvendorinfo,
    fact_highweedsandgrassdetails.mowingstatus,
    fact_highweedsandgrassdetails.receiveddateid,
    fact_highweedsandgrassdetails.assignedtovendordateid,
    fact_highweedsandgrassdetails.assignedtovendor,
    fact_highweedsandgrassdetails.reassigneddateid,
    fact_highweedsandgrassdetails.reassignedtovendor,
    fact_highweedsandgrassdetails.currentvendor,
    fact_highweedsandgrassdetails.currentassigneddateid,
    fact_highweedsandgrassdetails.mowingduedateid,
    fact_highweedsandgrassdetails.vendormoweddateid,
    fact_highweedsandgrassdetails.invoiced,
    fact_highweedsandgrassdetails.invoicedstatus,
    fact_highweedsandgrassdetails.invoicedstatusdateid,
    fact_highweedsandgrassdetails.vendorinvoicenumber,
    fact_highweedsandgrassdetails.vendorcomments,
    fact_casedetails.captypename,
    fact_casedetails.casenumbersubgroup,
    fact_casedetails.casetype,
    fact_casedetails.township,
    fact_casedetails.casestatus,
    fact_casedetails.caseopendateid,
    fact_casedetails.referredtolegalflag,
    fact_casedetails.macinitiatedflag,
    fact_casedetails.conversionstatusdesc,
    fact_casedetails.assignedstaff,
    fact_casedetails.completedstaff,
    fact_casedetails.closedbystaff,
    fact_casedetails.initiator,
    fact_casedetails.reasonforinvestigation,
    fact_casedetails.primaryaddress,
    fact_casedetails.parcelnumber,
    fact_highweedsandgrassdetails.vendormoweddatetime,
    Cast(Datediff([day],
    fact_highweedsandgrassdetails.receiveddatetime,
    COALESCE (
    fact_highweedsandgrassdetails.casecloseddate,
    fact_highweedsandgrassdetails.vendormoweddate,
    fact_highweedsandgrassdetails.recordimportdatetime))
    AS
    NUMERIC(9, 2)),
    Cast(Datediff([day],
    fact_highweedsandgrassdetails.receiveddatetime,
    COALESCE (
    fact_highweedsandgrassdetails.vendormoweddate,
    fact_highweedsandgrassdetails.casecloseddate,
    fact_highweedsandgrassdetails.recordimportdatetime))
    AS
    NUMERIC(9, 2)),
    Cast(Datediff([day],
    fact_highweedsandgrassdetails.assignedtovendordate,
    COALESCE (
    fact_highweedsandgrassdetails.vendormoweddate,
    fact_highweedsandgrassdetails.casecloseddate,
    fact_highweedsandgrassdetails.recordimportdatetime))
    AS
    NUMERIC(9, 2)),
    CASE
    WHEN mowingstatus = 'Mowed'
    OR mowingstatus = 'Closed' THEN 1
    ELSE 0
    END,
    fact_highweedsandgrassdetails.recordimportdatetime,
    fact_casedetails.macsiebelnumber,
    fact_highweedsandgrassdetails.mowingduedate,
    fact_highweedsandgrassdetails.vendormoweddate,
    fact_highweedsandgrassdetails.lastfeeinvoicedate,
    fact_highweedsandgrassdetails.investigationopendatetime,
    fact_highweedsandgrassdetails.investigationopendate,
    fact_highweedsandgrassdetails.investigationopendateid,
    Cast(Datediff([day],
    fact_highweedsandgrassdetails.investigationopendatetime,
    CASE
    WHEN
    ( vendormoweddatetime IS NOT NULL
    AND vendormoweddatetime <=
    fact_highweedsandgrassdetails.casecloseddate ) THEN
    fact_highweedsandgrassdetails.vendormoweddatetime
    ELSE
    CASE
    WHEN (
    fact_highweedsandgrassdetails.casecloseddate
    IS NOT NULL
    AND
    fact_highweedsandgrassdetails.casecloseddate <=
    fact_highweedsandgrassdetails.recordimportdatetime )
    THEN
    fact_highweedsandgrassdetails.casecloseddate
    ELSE
    fact_highweedsandgrassdetails.recordimportdatetime
    END
    END) AS NUMERIC(9, 2)),
    Cast(Datediff(ss,
    fact_highweedsandgrassdetails.investigationopendatetime,
    CASE
    WHEN
    COALESCE (vendormoweddatetime,
    fact_highweedsandgrassdetails.casecloseddate) IS
    NOT NULL THEN COALESCE (vendormoweddatetime,
    fact_highweedsandgrassdetails.casecloseddate)
    ELSE
    CASE
    WHEN
    ( fact_highweedsandgrassdetails.casecloseddate IS NOT NULL
    AND fact_highweedsandgrassdetails.casecloseddate <=
    fact_highweedsandgrassdetails.recordimportdatetime ) THEN
    fact_highweedsandgrassdetails.casecloseddate
    ELSE fact_highweedsandgrassdetails.recordimportdatetime
    END
    END) AS NUMERIC(18, 2)) * 60,
    fact_casedetails.assigneddepartment,
    COALESCE (fact_casedetails.assignedstaff, '[null]')
    + '/'
    + COALESCE (fact_casedetails.assigneddepartment, '[null]'),
    fact_highweedsandgrassdetails.casecloseddate,
    fact_highweedsandgrassdetails.receiveddatetime,
    fact_highweedsandgrassdetails.assignedtovendordate,
    fact_highweedsandgrassdetails.vendorinvoiceamount,
    fact_highweedsandgrassdetails.invoicedstatusdate,
    fact_highweedsandgrassdetails.complaint_source,
    fact_highweedsandgrassdetails.inspection_result,
    fact_highweedsandgrassdetails.reason_for_complaint,
    fact_highweedsandgrassdetails.contractcompliancevendor,
    fact_highweedsandgrassdetails.vendor_action,
    fact_highweedsandgrassdetails.date_of_complaint_id,
    fact_highweedsandgrassdetails.date_of_inspection_id,
    CONVERT(INT, Replace(
    Replace(fact_highweedsandgrassdetails.casenumber, 'HWG', 0)
    , '-', 0)),
    fact_highweedsandgrassdetails.maccomments,
    dbo.dim_highweedscensustracts.b1_census_tract) AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS]
    ORDER BY [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[compliancejoin]
    ASC
    SV

    I just counted the columns from the top:
    1) compliancejoin, 2) mowingsector, 3) caseclosedflag, 4) casehasvendorinfo, 5) mowingstatus, 6) assignedtovendor.
    I see now that your subject line talks about column 6, but you say column 5 in body of your original post.
    I don't know anything about cubes, but apparently there is some mapping problem when you run it from SSAS. (I assume it is SSAS, a part of the product I'm entirely ignorant of.) I figured that if you had got tripped by the zero-based numbering, you
    might be staring on the wrong column.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Errors in the back-end database access module. OLE DB was unable to convert a value to the data type requested for column 6.

    Hi All,
    I'm still struggling with the same cube and this is my 3rd post and once i fix some thing the other breaks. Please forgive me. When i process my cube i'm getting the error:
    Errors in the back-end database access module. OLE DB was unable to convert a value to the data type requested for column 5.
    My question is when the error says column 5 (is it the column 5 in the DSV?) or is it the column 5 in the DIMENSION list?
    My next question is the DSV Query works perfectly fine , so why this error in cube? This is what i have in the query in DSV.
    Please need help. In the below query both the column 5 (ArEASSIGNED TO VENDOR) in the CUBE and underlying table have the same data type and length VARCHAR(4000). Why is the process failing still?
    SELECT [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[compliancejoin]
    AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_0],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[mowingsector]
    AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_1],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[caseclosedflag]
    AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_2],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[casehasvendorinfo]
    AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_3],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[mowingstatus]
    AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_4],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[assignedtovendor]
    AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_5],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[reassignedtovendor]
    AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_6],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[currentvendor]
    AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_7],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[invoiced]
    AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTSInvoiced0_8],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[invoicedstatus]
    AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_9],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[casecloseddateid]
    AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_10],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[assignedtovendordateid] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_11],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[reassigneddateid] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_12],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[currentassigneddateid] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_13],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[mowingduedateid] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_14],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[vendormoweddateid] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_15],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[captypename] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_16],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[casetype] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTSCaseType0_17],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[casenumbersubgroup] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_18],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[casetownship] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_19],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[casestatus] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTSCaseStatus0_20],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[caseopendateid] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_21],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[casereferredtolegalflag]
    AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_22],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[casemacinitiatedflag] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_23],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[caseconversionstatusdesc]
    AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_24],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[reasonforinvestigation] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_25],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[investigationopendateid]
    AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_26],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[receiveddateid] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_27],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[assigned_department_staff]
    AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_28],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[caseinitiator] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_29],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[vendorinvoiceamount] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_30],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[inspection_result] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_31],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[reason_for_complaint] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_32],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[vendor_action] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_33],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[complaint_source] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_34],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[contractcompliancevendor]
    AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_35],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[invoicedstatusdateid] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_36],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[date_of_complaint_id] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_37],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[date_of_inspection_id] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_38],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[casenumber] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTSCaseNumber0_39],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[parcelnumber] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_40],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[row_index] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTSROW_INDEX0_41]
    FROM (SELECT CASE Isnumeric(
    accela_staging.dbo.fact_highweedsandgrassdetails.vendorinvoiceamount)
    WHEN 1 THEN Cast(
    fact_highweedsandgrassdetails.vendorinvoiceamount AS
    VARCHAR(
    10))
    END AS
    Total_Dollar_Amount,
    fact_highweedsandgrassdetails.casenumber,
    fact_highweedsandgrassdetails.row_index,
    fact_highweedsandgrassdetails.mowingsector,
    fact_highweedsandgrassdetails.caseclosedflag,
    fact_highweedsandgrassdetails.casecloseddateid,
    fact_highweedsandgrassdetails.maccomments,
    fact_highweedsandgrassdetails.lastfeeinvoicedateid,
    fact_highweedsandgrassdetails.casehasvendorinfo,
    fact_highweedsandgrassdetails.mowingstatus,
    fact_highweedsandgrassdetails.receiveddateid,
    fact_highweedsandgrassdetails.assignedtovendordateid,
    fact_highweedsandgrassdetails.assignedtovendor,
    fact_highweedsandgrassdetails.reassigneddateid,
    fact_highweedsandgrassdetails.reassignedtovendor,
    fact_highweedsandgrassdetails.currentvendor,
    fact_highweedsandgrassdetails.currentassigneddateid,
    fact_highweedsandgrassdetails.mowingduedateid,
    fact_highweedsandgrassdetails.vendormoweddateid,
    fact_highweedsandgrassdetails.invoiced,
    fact_highweedsandgrassdetails.invoicedstatus,
    fact_highweedsandgrassdetails.invoicedstatusdateid,
    fact_highweedsandgrassdetails.vendorinvoicenumber,
    fact_highweedsandgrassdetails.vendorcomments,
    fact_casedetails.captypename,
    fact_casedetails.casenumbersubgroup,
    fact_casedetails.casetype,
    fact_casedetails.township AS
    CaseTownship,
    fact_casedetails.casestatus,
    fact_casedetails.caseopendateid,
    fact_casedetails.referredtolegalflag AS
    CaseReferredToLegalFlag,
    fact_casedetails.macinitiatedflag AS
    CaseMACInitiatedFlag,
    fact_casedetails.conversionstatusdesc AS
    CaseConversionStatusDesc,
    fact_casedetails.assignedstaff AS
    CaseAssignedStaff,
    fact_casedetails.completedstaff AS
    CaseCompletedStaff,
    fact_casedetails.closedbystaff AS
    CaseClosedByStaff,
    fact_casedetails.initiator AS
    CaseInitiator,
    fact_casedetails.reasonforinvestigation,
    fact_casedetails.primaryaddress,
    fact_casedetails.parcelnumber,
    Cast(Datediff([day],
    fact_highweedsandgrassdetails.receiveddatetime,
    COALESCE (fact_highweedsandgrassdetails.casecloseddate,
    fact_highweedsandgrassdetails.vendormoweddate,
    fact_highweedsandgrassdetails.recordimportdatetime)) AS
    DECIMAL(6, 2))
    AS
    DaysOpen,
    Cast(Datediff([day],
    fact_highweedsandgrassdetails.receiveddatetime,
    COALESCE
    (fact_highweedsandgrassdetails.vendormoweddate,
    fact_highweedsandgrassdetails.casecloseddate,
    fact_highweedsandgrassdetails.recordimportdatetime)) AS
    NUMERIC(9, 2))
    * 24 AS
    HoursOpenToMow,
    Cast(Datediff([day],
    fact_highweedsandgrassdetails.assignedtovendordate,
    COALESCE
    (fact_highweedsandgrassdetails.vendormoweddate,
    fact_highweedsandgrassdetails.casecloseddate,
    fact_highweedsandgrassdetails.recordimportdatetime)) AS
    NUMERIC(9, 2))
    * 24 AS
    HoursAssignedToMow,
    CASE
    WHEN mowingstatus = 'Mowed'
    OR mowingstatus = 'Closed' THEN 1
    ELSE 0
    END AS
    NumberComplete,
    fact_highweedsandgrassdetails.recordimportdatetime,
    fact_casedetails.macsiebelnumber,
    fact_highweedsandgrassdetails.mowingduedate,
    fact_highweedsandgrassdetails.vendormoweddate,
    fact_highweedsandgrassdetails.lastfeeinvoicedate,
    fact_highweedsandgrassdetails.investigationopendatetime,
    fact_highweedsandgrassdetails.investigationopendate,
    fact_highweedsandgrassdetails.investigationopendateid,
    Cast(Datediff([day],
    fact_highweedsandgrassdetails.investigationopendatetime,
    CASE
    WHEN
    ( vendormoweddatetime IS NOT NULL
    AND vendormoweddatetime <=
    fact_highweedsandgrassdetails.casecloseddate ) THEN
    fact_highweedsandgrassdetails.vendormoweddatetime
    ELSE
    CASE
    WHEN (
    fact_highweedsandgrassdetails.casecloseddate IS
    NOT NULL
    AND fact_highweedsandgrassdetails.casecloseddate
    <=
    fact_highweedsandgrassdetails.recordimportdatetime )
    THEN
    fact_highweedsandgrassdetails.casecloseddate
    ELSE fact_highweedsandgrassdetails.recordimportdatetime
    END
    END) AS NUMERIC(9, 2)) * 24 AS
    AbatementDurationHoursOLD,
    Cast(Datediff([day],
    fact_highweedsandgrassdetails.investigationopendatetime,
    CASE
    WHEN
    COALESCE (vendormoweddatetime,
    fact_highweedsandgrassdetails.casecloseddate) IS
    NOT NULL THEN COALESCE (vendormoweddatetime,
    fact_highweedsandgrassdetails.casecloseddate)
    ELSE
    CASE
    WHEN ( fact_highweedsandgrassdetails.casecloseddate IS NOT NULL
    AND fact_highweedsandgrassdetails.casecloseddate <=
    fact_highweedsandgrassdetails.recordimportdatetime ) THEN
    fact_highweedsandgrassdetails.casecloseddate
    ELSE fact_highweedsandgrassdetails.recordimportdatetime
    END
    END) AS NUMERIC(9, 2)) * 24 AS
    AbatementDurationHours,
    fact_casedetails.assigneddepartment,
    COALESCE (fact_casedetails.assignedstaff, '[null]')
    + '/'
    + COALESCE (fact_casedetails.assigneddepartment, '[null]') AS
    Assigned_Department_Staff,
    fact_highweedsandgrassdetails.casecloseddate,
    fact_highweedsandgrassdetails.receiveddatetime,
    fact_highweedsandgrassdetails.assignedtovendordate,
    fact_highweedsandgrassdetails.vendorinvoiceamount,
    fact_highweedsandgrassdetails.invoicedstatusdate,
    fact_highweedsandgrassdetails.complaint_source,
    fact_highweedsandgrassdetails.inspection_result,
    fact_highweedsandgrassdetails.reason_for_complaint,
    fact_highweedsandgrassdetails.contractcompliancevendor,
    fact_highweedsandgrassdetails.vendor_action,
    fact_highweedsandgrassdetails.date_of_complaint_id,
    fact_highweedsandgrassdetails.date_of_inspection_id,
    CONVERT(INT, Replace(Replace(fact_highweedsandgrassdetails.casenumber,
    'HWG', 0)
    , '-', 0)) AS compliancejoin,
    fact_highweedsandgrassdetails.maccomments AS Expr1,
    dbo.dim_highweedscensustracts.b1_census_tract
    FROM dbo.fact_highweedsandgrassdetails
    INNER JOIN dbo.fact_casedetails
    ON fact_highweedsandgrassdetails.casenumber =
    fact_casedetails.casenumber
    INNER JOIN dbo.dim_highweedscensustracts
    ON fact_highweedsandgrassdetails.casenumber =
    dbo.dim_highweedscensustracts.casenumber
    GROUP BY fact_highweedsandgrassdetails.casenumber,
    fact_highweedsandgrassdetails.row_index,
    fact_highweedsandgrassdetails.mowingsector,
    fact_highweedsandgrassdetails.caseclosedflag,
    fact_highweedsandgrassdetails.casecloseddateid,
    fact_highweedsandgrassdetails.maccomments,
    fact_highweedsandgrassdetails.lastfeeinvoicedateid,
    fact_highweedsandgrassdetails.casehasvendorinfo,
    fact_highweedsandgrassdetails.mowingstatus,
    fact_highweedsandgrassdetails.receiveddateid,
    fact_highweedsandgrassdetails.assignedtovendordateid,
    fact_highweedsandgrassdetails.assignedtovendor,
    fact_highweedsandgrassdetails.reassigneddateid,
    fact_highweedsandgrassdetails.reassignedtovendor,
    fact_highweedsandgrassdetails.currentvendor,
    fact_highweedsandgrassdetails.currentassigneddateid,
    fact_highweedsandgrassdetails.mowingduedateid,
    fact_highweedsandgrassdetails.vendormoweddateid,
    fact_highweedsandgrassdetails.invoiced,
    fact_highweedsandgrassdetails.invoicedstatus,
    fact_highweedsandgrassdetails.invoicedstatusdateid,
    fact_highweedsandgrassdetails.vendorinvoicenumber,
    fact_highweedsandgrassdetails.vendorcomments,
    fact_casedetails.captypename,
    fact_casedetails.casenumbersubgroup,
    fact_casedetails.casetype,
    fact_casedetails.township,
    fact_casedetails.casestatus,
    fact_casedetails.caseopendateid,
    fact_casedetails.referredtolegalflag,
    fact_casedetails.macinitiatedflag,
    fact_casedetails.conversionstatusdesc,
    fact_casedetails.assignedstaff,
    fact_casedetails.completedstaff,
    fact_casedetails.closedbystaff,
    fact_casedetails.initiator,
    fact_casedetails.reasonforinvestigation,
    fact_casedetails.primaryaddress,
    fact_casedetails.parcelnumber,
    fact_highweedsandgrassdetails.vendormoweddatetime,
    Cast(Datediff([day],
    fact_highweedsandgrassdetails.receiveddatetime,
    COALESCE (
    fact_highweedsandgrassdetails.casecloseddate,
    fact_highweedsandgrassdetails.vendormoweddate,
    fact_highweedsandgrassdetails.recordimportdatetime))
    AS
    NUMERIC(9, 2)),
    Cast(Datediff([day],
    fact_highweedsandgrassdetails.receiveddatetime,
    COALESCE (
    fact_highweedsandgrassdetails.vendormoweddate,
    fact_highweedsandgrassdetails.casecloseddate,
    fact_highweedsandgrassdetails.recordimportdatetime))
    AS
    NUMERIC(9, 2)),
    Cast(Datediff([day],
    fact_highweedsandgrassdetails.assignedtovendordate,
    COALESCE (
    fact_highweedsandgrassdetails.vendormoweddate,
    fact_highweedsandgrassdetails.casecloseddate,
    fact_highweedsandgrassdetails.recordimportdatetime))
    AS
    NUMERIC(9, 2)),
    CASE
    WHEN mowingstatus = 'Mowed'
    OR mowingstatus = 'Closed' THEN 1
    ELSE 0
    END,
    fact_highweedsandgrassdetails.recordimportdatetime,
    fact_casedetails.macsiebelnumber,
    fact_highweedsandgrassdetails.mowingduedate,
    fact_highweedsandgrassdetails.vendormoweddate,
    fact_highweedsandgrassdetails.lastfeeinvoicedate,
    fact_highweedsandgrassdetails.investigationopendatetime,
    fact_highweedsandgrassdetails.investigationopendate,
    fact_highweedsandgrassdetails.investigationopendateid,
    Cast(Datediff([day],
    fact_highweedsandgrassdetails.investigationopendatetime,
    CASE
    WHEN
    ( vendormoweddatetime IS NOT NULL
    AND vendormoweddatetime <=
    fact_highweedsandgrassdetails.casecloseddate ) THEN
    fact_highweedsandgrassdetails.vendormoweddatetime
    ELSE
    CASE
    WHEN (
    fact_highweedsandgrassdetails.casecloseddate
    IS NOT NULL
    AND
    fact_highweedsandgrassdetails.casecloseddate <=
    fact_highweedsandgrassdetails.recordimportdatetime )
    THEN
    fact_highweedsandgrassdetails.casecloseddate
    ELSE
    fact_highweedsandgrassdetails.recordimportdatetime
    END
    END) AS NUMERIC(9, 2)),
    Cast(Datediff(ss,
    fact_highweedsandgrassdetails.investigationopendatetime,
    CASE
    WHEN
    COALESCE (vendormoweddatetime,
    fact_highweedsandgrassdetails.casecloseddate) IS
    NOT NULL THEN COALESCE (vendormoweddatetime,
    fact_highweedsandgrassdetails.casecloseddate)
    ELSE
    CASE
    WHEN
    ( fact_highweedsandgrassdetails.casecloseddate IS NOT NULL
    AND fact_highweedsandgrassdetails.casecloseddate <=
    fact_highweedsandgrassdetails.recordimportdatetime ) THEN
    fact_highweedsandgrassdetails.casecloseddate
    ELSE fact_highweedsandgrassdetails.recordimportdatetime
    END
    END) AS NUMERIC(18, 2)) * 60,
    fact_casedetails.assigneddepartment,
    COALESCE (fact_casedetails.assignedstaff, '[null]')
    + '/'
    + COALESCE (fact_casedetails.assigneddepartment, '[null]'),
    fact_highweedsandgrassdetails.casecloseddate,
    fact_highweedsandgrassdetails.receiveddatetime,
    fact_highweedsandgrassdetails.assignedtovendordate,
    fact_highweedsandgrassdetails.vendorinvoiceamount,
    fact_highweedsandgrassdetails.invoicedstatusdate,
    fact_highweedsandgrassdetails.complaint_source,
    fact_highweedsandgrassdetails.inspection_result,
    fact_highweedsandgrassdetails.reason_for_complaint,
    fact_highweedsandgrassdetails.contractcompliancevendor,
    fact_highweedsandgrassdetails.vendor_action,
    fact_highweedsandgrassdetails.date_of_complaint_id,
    fact_highweedsandgrassdetails.date_of_inspection_id,
    CONVERT(INT, Replace(
    Replace(fact_highweedsandgrassdetails.casenumber, 'HWG', 0)
    , '-', 0)),
    fact_highweedsandgrassdetails.maccomments,
    dbo.dim_highweedscensustracts.b1_census_tract) AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS]
    ORDER BY [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[compliancejoin]
    ASC
    SV

    I just counted the columns from the top:
    1) compliancejoin, 2) mowingsector, 3) caseclosedflag, 4) casehasvendorinfo, 5) mowingstatus, 6) assignedtovendor.
    I see now that your subject line talks about column 6, but you say column 5 in body of your original post.
    I don't know anything about cubes, but apparently there is some mapping problem when you run it from SSAS. (I assume it is SSAS, a part of the product I'm entirely ignorant of.) I figured that if you had got tripped by the zero-based numbering, you
    might be staring on the wrong column.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Hello, I have a question regarding the sharing/exporting on imovie. Whenever I click the share button all the normal options pop up, but when I actually click where I want to share it to nothing happens.  If you know what's wrong please let me know.

    Hello,  I have a question regarding the sharing on iMovie.  I have just recently purchased an Elgato Gaming Capture HD and I then finished my recording with that and put it into imovie.  I worked long and hard on the project and when I go click the share feature on iMovie all the noral options pop up and when I actually click where I want to share it to nothing at all happens.  If you know what is wrong/ what I am doing wrong please let me know.
    Thank you.
    PS:  I am using iMovie 10.0.6.

    /*line 957 error */
         public void select()
              for (count = 0; count <= p; count ++ )
                   if(P[count] != null){ /* validation */
                   m = (int)(P[count].getX());
                   n = (int)(P[count].getY());
                   if (Math.pow(-1, m + n) == 1)
                        piece[m][n].setBackground(wselect);
                   else
                        piece[m][n].setBackground(bselect);
              step = 2;
         }

  • How do you change the date/currency format for every user in OSX 10.6?

    I imaged a bunch of mac labs at work only to realize the base image has the date/currency set for United States rather then United Kingdom. The regional settings are correct.
    I tried changing it on the local admin account but it does not affect a new user that logs onto an AD account.
    Workgroup manager does not seem to offer anything either unless I am missing it.
    Any ideas?

    Hi Uncle,
    Page 116 of the Pages'09 User Guide: Control Click the date, Edit Date and Time.
    Date and time can also be in a table. Format the table cell.
    The User Guide is well worth a read. Download it from the Help menu in Pages.
    Regards,
    Ian.

  • Question regarding the pen tool (w/ picture inside)

    Hello everyone! I have a question regarding the pen tool. I think this picture is very helpful for my question:
    So in this pic is an orange rectangle and within that rectangle is a blue stripe. I would like the blue stripe to be perfectly flush (not over, and not under) the edge of the rectangle. For example, on the bottom end of the blue stripe, you can clearly see that the stripe does not extend far enough to the edge of the orange rectangle. At the top of the stripe, it goes a little bit over (a bit hard to see). I work with some complex shapes when using the pen tool and it is really slowing me down to compensate for over/under shapes. If it could just snap to the borders of other shapes it would make my life a lot easier. Thanks for reading and please help!

    A couple of thoughts come to mind:
    1.  You could create the shape "face on", using guides, and the points will snap to guides with snap enabled.  Then you could transform the whole thing together by selecting all the shape layers.
    2.  Holding down the shift key while dragging a point seems to cause it to snap to some things under some conditions. However, on having just tried to recreate what you're showing I didn't see the proper snap happening sometimes.
    3.  There's the full manual approach, of course where you zoom into thousands of percent and move the points by hand manually.  I assume this is what you're trying to avoid.
    -Noel

Maybe you are looking for

  • External display UNITED LED22W11 not detected

    I'm having problems trying to connect my external monitor UNITED LED22W11 to my MacBook Pro with OS X 10.9. Unfortunately I can't give you any other informations since when I plug it in through my Belkin mini displayport to HDMI adapter nothing happe

  • Downloaded photos not showing up in the usual places.

    I just downloaded 300 pictures from a CD.  The pictures only show up in the "last import", they don't show up in "photos", or "events".  In addition, when I go to Costco site to upload photos, none of my 2012 photos are showing up.  I click on iphoto

  • Help!  My iTunes Library has disappeared

    I moved my iTunes Music Folder to my external hard drive. I then started adding songs that were already on my external to my music folder. Now, my music that orginally in my music folder is no where to be found. Any ideas on where to start looking?

  • Displaying table using DBMS_OUTPUT using OWA

    Dear All, I have created a procedure to display a table in DBMS_OUTPUT (Thanks to Michaels) using OWA package. PROCEDURE showtable (tablename VARCHAR2) AS b BOOLEAN; OUT CLOB; irows INTEGER := 1; BEGIN OWA.cgi_var_name (1) := 1; OWA.init_cgi_env (OWA

  • Demo application removal script

    Where can I find a demo application (the one that comes with Oracle XE, APEX 3.0) removal script? I've tried to remove it via the application builder but something went wrong and the application is gone but the underlying tables are still there. I ca