Decode on date range

Hi ,
I have a oracle table in which i have 6 date fields ok.
I want to compare load_timestamp with all 6 date field to find out if load_timestamp date falls within the 6 date fields.
If it falls within range then I have to mark it 'ACTIVE' else 'INACTIVE'
business rule is as below:
if (date of load between county_begin_dt and count_end_dt) and (date of load between fund_begin_dt and fund_end_dt) and (date of load between svc_cd_begin_dt and svc_cd_end_dt) then 'ACTIVE' else 'INACTIVE'
I have tried using decode but give me error
select decode(load_ts between fund_begin_dt and fund_end_dt, 'active','inactive')
from table_name;
error-
ORA-00907: missing right parenthesis
Any help is appreciated.
Thanks in advance
JP

select
  case
    when (load_ts between county_begin_dt and count_end_dt) and
         (load_ts between fund_begin_dt and fund_end_dt) and
         (load_ts between svc_cd_begin_dt and svc_cd_end_dt)
    then 'ACTIVE'
    else 'INACTIVE'
  end as msg
from table_name;Depending on your requirements, you may want to use TRUNC function.
select
  case
    when (county_begin_dt <= load_ts and load_ts <= count_end_dt) and
         (fund_begin_dt   <= load_ts and load_ts <= fund_end_dt) and
         (svc_cd_begin_dt <= load_ts and load_ts <= svc_cd_end_dt)
    then 'ACTIVE'
    else 'INACTIVE'
  end as msg
from table_name;pratz

Similar Messages

  • Date range query  problem  in report

    Hi all,
    I have created a report based on query and i want to put date range selection but query giving problem.
    If i am creating select list selection then it is working fine means it will display all records on the particular date.
    But what i need is that user will enter date range as creation_date1,creation_date2 and query should return all the records between these date range. i want to pass it by creating items, i created two items and passing creation_date range to display all records but not displaying and if not passing date then should take null as default and display all records
    Here is the query:
    /* Formatted on 2006/12/10 20:01 (Formatter Plus v4.8.0) */
    SELECT tsh."SR_HEADER_ID", tsh."SALES_DEPT_NUMBER", tsh."COUNTRY",
    tsh."LOCAL_REPORT_NUMBER", tsh."ISSUE_DATE", tsh."SUBJECT",
    tsh."MACHINE_SERIAL_NUMBER", tsh."MACHINE_TYPE", tsh."MACHINE_HOURS",
    tsh."STATUS"
    FROM "TRX_SR_HEADERS" tsh, "TRX_SR_PARTS" tsp
    WHERE (tsh.status LIKE :p23_status_sp OR tsh.status IS NULL)
    AND (tsh.machine_type LIKE :p23_machine_type_sp)
    AND ( tsh.machine_serial_number LIKE
    TO_CHAR (:p23_machine_serial_number_sp)
    OR tsh.machine_serial_number IS NULL
    AND ( TO_CHAR (tsh.failure_date, 'DD-MON-YY') LIKE
    TO_CHAR (:p23_failure_date_sp)
    OR TO_CHAR (tsh.failure_date, 'DD-MON-YY') IS NULL
    AND ( TO_CHAR (tsh.creation_date, 'DD-MON-YY')
    BETWEEN TO_CHAR (:p23_creation_date_sp)
    AND TO_CHAR (:p23_creation_date_sp1)
    OR TO_CHAR (tsh.creation_date, 'DD-MON-YY') IS NULL
    AND (tsh.issue_date LIKE :p23_date_of_issue_sp OR tsh.issue_date IS NULL)
    AND (tsh.country LIKE :p23_country_sp OR tsh.country IS NULL)
    AND ( tsh.local_report_number LIKE TO_CHAR (:p23_local_rep_num_sp)
    OR tsh.local_report_number IS NULL
    AND ( tsp.part_number LIKE TO_CHAR (:p23_part_number_sp)
    OR tsp.part_number IS NULL
    AND tsh.machine_type IN (
    SELECT DISTINCT machine_type
    FROM trx_sales_dept_machine_list
    WHERE sales_department_id IN (
    SELECT DISTINCT sales_department_id
    FROM trx_user_sales_department
    WHERE UPPER (user_name) =
    UPPER ('&APP_USER.'))
    AND SYSDATE >= valid_from)
    AND tsh.sr_header_id = tsp.sr_header_id
    can any one tell me wat is wroung in this query.
    Any other way to write this?
    Thank You,
    Amit

    Hi User....
    Here is some date range SQL that my teams uses with some success:
    For date columns that do not contain NULL values, try this (note the TRUNC, it might help with your "today" problem).
    The hard coded dates allow users to leave the FROM and TO dates blank and still get sensible results (ie a blank TO date field asks for all dates in the future.
    AND TRUNC(DATE_IN_DATABASE)
    BETWEEN
    decode( :P1_DATE_FROM,
    TO_DATE('01-JAN-1900'),
    :P1_DATE_FROM)
    AND
    decode( :P1_DATE_TO,
    TO_DATE('31-DEC-3000'),:
    :P1_DATE_TO)
    For date columns that contain NULL values, try this (a little bit trickier):
    AND nvl(TRUNC(DATE_IN_DATABASE),
    decode( :P1_DATE_FROM,
    decode( :P1_DATE_TO,
    TO_DATE('30-DEC-3000'),
    NULL),
    NULL)
    BETWEEN
    decode( :P1_DATE_FROM,
    TO_DATE('01-JAN-1900'),
    :P1_DATE_FROM)
    AND
    decode( :P1_DATE_TO,
    TO_DATE('31-DEC-3000'),
    :P1_DATE_TO)
    Note the 30-DEC-3000 versus 31-DEC-3000. This trick returns the NULL dates when the FROM and TO date range items are both blank.
    I hope this helps.
    By the way, does anyone have a better way of doing this? The requirement is given a date column in a database and a FROM and a TO date item on a page,
    find all of the dates in the database between the FROM and TO dates. If the FROM date is blank, assume the user want all dates in the past (excluding NULL dates). If the TO date is blank, assume that the user wants all of the dates in the future (excluding NULL dates). If both FROM and TO dates are blank, return all of the dates in the databse (including NULL dates).
    Cheers,
    Patrick

  • Regarding large date range

    hi all,
    i am using Forms [32 Bit] Version 6.0.8.24.1 (Production)
    Oracle Database 10g Release 10.2.0.1.0 - Production
    i am selecting some fileds from some tables for certain condition
    for ex:
    select a,b,c
    from table1
    where trunc(col) between from_date and to_date
    with the help of cursor i am accessing these selected columns.
    the problem is if i run it for small date range(from 01-jan-2009 to 10-jan-2009) its giving the correct result but if i run it for large date range for example 2005 to 2011 i am getting error as ora-302000.
    i have written this code in the button in the front end.
    what could be the reason behind this?
    Please help to sort it out..
    Thanks..

    I appreciate your views. However here is why it works...
    The default date format is DD-MON-RR (RR Date Format)
    Oracle does an implicit convertion from CHAR to DATE when we specify in this format 'DD-MON-RR'
    Here is how it works...
    SELECT * FROM EMP WHERE TRUNC(HIREDATE) = '17-DEC-80'This SQL will give me this record from emp table
    SQL> SELECT * FROM EMP WHERE TRUNC(HIREDATE) = '17-DEC-80';
    EMPNO     ENAME     JOB     MGR     HIREDATE     SAL     COMM     DEPTNO
    7369     SMITH     CLERK     7902     17-12-1980     800          20Regarding, specifying 2 digits for the year. Oracle is intelligent enough to decode it based on its built-in internal functionality...
    Quoting from Oracle Docs..
    •If the specified two-digit year is 00 to 49, then
        ◦If the last two digits of the current year are 00 to 49, then the returned year has the same first two digits as the current year.
        ◦If the last two digits of the current year are 50 to 99, then the first 2 digits of the returned year are 1 greater than the first 2 digits of the current year.
    •If the specified two-digit year is 50 to 99, then
        ◦If the last two digits of the current year are 00 to 49, then the first 2 digits of the returned year are 1 less than the first 2 digits of the current year.
        ◦If the last two digits of the current year are 50 to 99, then the returned year has the same first two digits as the current year.To know more about implicit year decoding you can refer this.
    Look for The RR Datetime Format Element at this page http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/sql_elements004.htm#SQLRF00210
    Regards,
    Rakesh
    Edited by: Rakesh Desai on Mar 28, 2011 8:11 PM

  • Oracle 10g - Problem with Date Ranges using Between

    I am keeping track of patients who have not been contacted during a date range. if a nurse adds an event or note and the note is type 1,3,4 then this is a contact. The following works but if the event or note was made on the same day as the report is run, the current contact is not printed. Any help to improve the query and identify the problem would be appreciated. Also, if you add '1' to' n.created_date_time BETWEEN '10-Jan-2010' AND TRUNC(SYSDATE)' so it is ' n.created_date_time BETWEEN '10-Jan-2010' AND TRUNC(SYSDATE) + 1'. It works. What is wrong?
    SELECT upper(symptom_text),
      COUNT(UNIQUE(c.patient_id)) ,
      COUNT(UNIQUE(
      CASE
        WHEN e.eventdate BETWEEN '10-Jan-2010' AND TRUNC(SYSDATE)
        OR (n.created_date_time BETWEEN '10-Jan-2010' AND TRUNC(SYSDATE)
        AND n.note_type_id                                             IN (1,3,4))
        THEN c.patient_id
        ELSE 0
      END)) - 1
    FROM patient c,
      cust_info ci,
      event e,
      note n
    WHERE c.physician_id = 74
    AND c.patient_id      = ci.patient_id
    AND ci.info_type_id    = 32
    AND ci.symptom_text      IS NOT NULL
    AND c.patient_id      = e.patient_id(+)
    AND c.patient_id      = n.pk_id(+)
    AND n.table_name(+)    = 'patient'
    GROUP BY upper(symptom_text)
    ORDER BY DECODE(upper(symptom_text), 'A+', 1, 'A', 2, 'B', 3, 'C', 4, 'D', 5, 99)I suspect the end date is not inclusive. Fields are Date data types. Thanks for any help.

    Hi,
    achtung wrote:
    Understood. Frank was correct. Do you mean about the dates? Is that issue solved now?
    It would help a lot if you posted some sample data (CREATE TABLE and INSERT statements) and the results you want from that data. Simplify as much as possible. For example, if everything involving the e and n tables is working correctly, forget about them for now. Post a question that only invloves the c and ci tables.
    But, additionally, when a record in the cust_info doesn't exist my contact count is inaccurate. How can you explain this conceptually. I understand the query path is checking for this record due to the predicate. Perhaps the query should be redesigned. Thanks for your input!Again, you can see the results, and you know what they should be. Nobody else has that information. Please post some sample data and the results you want from that data.
    In your earlier message you said
    Could there be a problem if a record does not exist in the ci table?The condition:
    AND ci.symptom_text IS NOT NULL
    filters for this right? Maybe this could be part of the problem. why I'm not seeing records when a note is added to a patient's doc. How would this be technically be explained? You're doing a inner join between c and ci:
        AND c.patient_id      = ci.patient_id
        AND ci.info_type_id   = 32
        AND ci.symptom_text   IS NOT NULL ...Rows from c will be included only if there is a row in ci with the same patiend_id: even more, that matching row in ci must also have info_type_id=32 in a non-NULL symptom_text, otherwise, the row from c will be ignored.
    If you want rows from c to be included even if there is no matching row in ci, then do an outer join, like you're already doing with the e and n tables:
      WHERE c.physician_id = 74
        AND c.patient_id         = ci.patient_id (+)
        AND ci.info_type_id (+)  = 32
        AND ci.symptom_text (+)  IS NOT NULL
        AND c.patient_id         = e.patient_id(+)
        AND c.patient_id         = n.pk_id(+)
        AND n.table_name(+)      = 'patient'

  • Discoverer Date Range Union Query

    Hi All,
    I need your help in creating a discovere report in version 11G.
    Following Report find missing elimination account based on Transaction done in a date Range. Find out how many accounts are not defined in Elimination Account Setup. Following query gives me desired output but i am having hard time creating a discoverer report for Date Range Parameter as Date Range only applied to one side of union.
    In First Query i used decode with sysdate itself so that i can use effective_date as parameter and second side i just kept sysdate.
    PLease let me know how can i create a parameterized report for effective_date range.
    SELECT
        /*+ ORDERED
        USE_NL(jel jeh jeb cat src)
        INDEX(jel GL_JE_LINES_N1)
        INDEX(jeh GL_JE_HEADERS_U1)
        INDEX(jeb GL_JE_BATCHES_U1)
        INDEX(cat GL_JE_CATEGORIES_TL_U1)
        INDEX(src GL_JE_SOURCES_TL_U1) */
        CC.SEGMENT1
        ||'.'
        ||CC.segment2
        ||'.'
        ||CC.segment3
        ||'.'
        ||cc.segment4
        ||'.'
        || cc.segment5
        ||'.'
        || cc.segment6 Account,
        decode(sysdate,sysdate,sysdate,jel.effective_date) trx_date
      FROM gl_code_combinations cc,
        gl_je_lines jel,
        gl_je_headers jeh,
        gl_je_batches jeb,
        gl_je_categories cat,
        gl_je_sources src
      WHERE cc.CHART_OF_ACCOUNTS_ID = 50308
      AND cc.segment2              IN ('111710','201910')
      AND jel.code_combination_id   = cc.code_combination_id
      AND jel.status
        || ''                = 'P'
      AND (jel.accounted_cr != 0
      OR jel.accounted_dr   != 0)
      AND jeh.je_header_id   = jel.je_header_id
      AND jeh.actual_flag    = 'A'
      AND jeh.currency_code       != 'STAT'
      AND jeb.je_batch_id          = jeh.je_batch_id
      AND jeb.average_journal_flag = 'N'
      AND src.je_source_name       = jeh.je_source
      AND cat.je_category_name     = jeh.je_category
      and jel.effective_date between to_date('01-JAN-2011','DD-MON-RRRR') and to_date('31-MAY-2011','DD-MON-RRRR')
      MINUS
      SELECT (source_segment1
        ||'.'
        ||source_segment2
        ||'.'
        ||source_segment3
        ||'.'
        ||source_segment4
        ||'.'
        ||source_segment5
        ||'.'
        ||source_segment6) def_acnt,
        sysdate
      FROM GL_ELIM_ACCOUNTS_MAP

    Hi,
    You can use the following SQL to get the effective date into the SQL and by that create the condition in the report:
    SELECT
    CC.SEGMENT1
    ||'.'
    ||CC.segment2
    ||'.'
    ||CC.segment3
    ||'.'
    ||cc.segment4
    ||'.'
    || cc.segment5
    ||'.'
    || cc.segment6 Account,
    decode(sysdate,sysdate,sysdate,jel.effective_date) trx_date,
    jel.effective_date
    FROM gl_code_combinations cc,
    gl_je_lines jel,
    gl_je_headers jeh,
    gl_je_batches jeb,
    gl_je_categories cat,
    gl_je_sources src
    WHERE cc.CHART_OF_ACCOUNTS_ID = 50308
    AND cc.segment2 IN ('111710','201910')
    AND jel.code_combination_id = cc.code_combination_id
    AND jel.status
    || '' = 'P'
    AND (jel.accounted_cr != 0
    OR jel.accounted_dr != 0)
    AND jeh.je_header_id = jel.je_header_id
    AND jeh.actual_flag = 'A'
    AND jeh.currency_code != 'STAT'
    AND jeb.je_batch_id = jeh.je_batch_id
    AND jeb.average_journal_flag = 'N'
    AND src.je_source_name = jeh.je_source
    AND cat.je_category_name = jeh.je_category
    AND NOT EXISTS (
    SELECT 1
    FROM GL_ELIM_ACCOUNTS_MAP
    WHERE CC.SEGMENT1 = source_segment1
    AND CC.segment2 = source_segment2
    AND CC.segment3 = source_segment3
    AND cc.segment4 = source_segment4
    AND cc.segment5 = source_segment5
    AND cc.segment6 = source_segment6
    AND decode(sysdate,sysdate,sysdate,jel.effective_date) = SYSDATE
    *** I removed the hints, but if you need those get them back
    *** BTW i didn't understand the logic behind the "decode(sysdate,sysdate,sysdate,jel.effective_date)" wouldn't it always be SYSDATE???
    Tamir

  • Multi-month, year, and date-range views

    My apologies for wasting everyone's time if I've missed something really obvious here, but am I correct in concluding that there is no way to generate anything beyond a static one-month view in iCal? No multi-month view? No year view? No "view date range"? At this stage of the game, how is it possible that something so elemental could be omitted from this program?
    At this point I'm reduced to exporting each month to a pdf file and then arranging them as tiles on the screen. But there has to be a better way.
    Short of a new version from Apple, are there any plug-ins that would do this? Does anyone have any other work-arounds? Thanks in advance.

    A quick search of the forums shows that this is a HIGHLY sought after feature (including by me). We all need to use the feed back link (below) to let Apple know this. In my experience with the tech support folks, they seem to have NO idea about what these forums say. In the past I have actually had them log in to these forums and search the issue I was calling them about and they have been blown away when they see the hundreds / thousands of posts with the very same thing they're discussing with me. So, as the wise man says .. "you don't ask, you don't get!" Use the form and let them know...
    http://www.apple.com/feedback/ical.html

  • How to get top 11 values per date range

    I want to get the top 11 values by date range.
    Sample Data
    CREATE TABLE SAMPLE_DATA
        DOMAIN_NAME VARCHAR2(100),
        QTD         NUMBER,
        LOAD_DATE   DATE
    -- Insert
    BEGIN
      FOR lc IN 1..20
      LOOP
        FOR ld IN 1..30
        LOOP
          INSERT
          INTO SAMPLE_DATA VALUES
              'DM_'
              ||lc,
              round(dbms_random.value(0,1000)),
              SYSDATE-ld
        END LOOP;
      END LOOP;
    COMMIT;
    END;
    SELECT *
    FROM
      (SELECT DOMAIN_NAME,
        QTD,
        LOAD_DATE
      FROM
        (SELECT DOMAIN_NAME,
          QTD,
          LOAD_DATE
        FROM SAMPLE_DATA
        WHERE LOAD_DATE = TRUNC(SYSDATE-3)
        ORDER BY QTD DESC
      WHERE ROWNUM <=10
      UNION ALL
      SELECT 'Others' DOMAIN_NAME,
        SUM(QTD) QTD,
        LOAD_DATE
      FROM
        (SELECT DOMAIN_NAME,
          QTD,
          LOAD_DATE
        FROM
          (SELECT rownum rn,
            DOMAIN_NAME,
            QTD,
            LOAD_DATE
          FROM
            (SELECT DOMAIN_NAME,
              QTD,
              LOAD_DATE
            FROM SAMPLE_DATA
            WHERE LOAD_DATE = TRUNC(SYSDATE-3)
            ORDER BY QTD DESC
        WHERE rn > 10
      GROUP BY LOAD_DATE
    ORDER BY QTD DESC
    -- Result
    DOMAIN_NAME                 QTD                         LOAD_DATE                  
    Others                      2888                        24/03/13                   
    DM_1                        1000                        24/03/13                   
    DM_20                       933                         24/03/13                   
    DM_11                       913                         24/03/13                   
    DM_3                        743                         24/03/13                   
    DM_13                       572                         24/03/13                   
    DM_12                       568                         24/03/13                   
    DM_9                        564                         24/03/13                   
    DM_6                        505                         24/03/13                   
    DM_5                        504                         24/03/13                   
    DM_2                        480                         24/03/13    
    Please, Help me get in one query this result using a range of date.
    e.g
    using LOAD_DATE BETWEEN '24/03/13' AND '25/03/13'
    DOMAIN_NAME                 QTD                         LOAD_DATE                  
    Others                      2888                        24/03/13                   
    DM_1                        1000                        24/03/13                   
    DM_20                       933                         24/03/13                   
    DM_11                       913                         24/03/13                   
    DM_3                        743                         24/03/13                   
    DM_13                       572                         24/03/13                   
    DM_12                       568                         24/03/13                   
    DM_9                        564                         24/03/13                   
    DM_6                        505                         24/03/13                   
    DM_5                        504                         24/03/13                   
    DM_2                        480                         24/03/13                     
    Others                      1948                        25/03/13                   
    DM_1                        807                         25/03/13                   
    DM_8                        764                         25/03/13                   
    DM_7                        761                         25/03/13                   
    DM_11                       656                         25/03/13                   
    DM_18                       611                         25/03/13                   
    DM_17                       523                         25/03/13                   
    DM_14                       467                         25/03/13                   
    DM_19                       447                         25/03/13                   
    DM_15                       437                         25/03/13                   
    DM_6                        380                         25/03/13             Thank you in advance.

    I got the solution. Just sharing.
    I used analytic functions that make my job easy.
    Sample Data
    DOMAIN_NAME                 QTD                         LOAD_DATE                  
    DM_1                        807                         25/03/2013                 
    DM_1                        1000                        24/03/2013                 
    DM_2                        226                         25/03/2013                 
    DM_2                        480                         24/03/2013                 
    DM_3                        244                         25/03/2013                 
    DM_3                        743                         24/03/2013                 
    DM_4                        48                          25/03/2013                 
    DM_4                        413                         24/03/2013                 
    DM_5                        164                         25/03/2013                 
    DM_5                        504                         24/03/2013                 
    DM_6                        380                         25/03/2013                 
    DM_6                        505                         24/03/2013                 
    DM_7                        761                         25/03/2013                 
    DM_7                        212                         24/03/2013                 
    DM_8                        764                         25/03/2013                 
    DM_8                        308                         24/03/2013                 
    DM_9                        354                         25/03/2013                 
    DM_9                        564                         24/03/2013                 
    DM_10                       214                         25/03/2013                 
    DM_10                       367                         24/03/2013                 
    DM_11                       656                         25/03/2013                 
    DM_11                       913                         24/03/2013                 
    DM_12                       37                          25/03/2013                 
    DM_12                       568                         24/03/2013                 
    DM_13                       332                         25/03/2013                 
    DM_13                       572                         24/03/2013                 
    DM_14                       467                         25/03/2013                 
    DM_14                       87                          24/03/2013                 
    DM_15                       437                         25/03/2013                 
    DM_15                       450                         24/03/2013                 
    DM_16                       238                         25/03/2013                 
    DM_16                       299                         24/03/2013                 
    DM_17                       523                         25/03/2013                 
    DM_17                       143                         24/03/2013                 
    DM_18                       611                         25/03/2013                 
    DM_18                       145                         24/03/2013                 
    DM_19                       447                         25/03/2013                 
    DM_19                       464                         24/03/2013                 
    DM_20                       91                          25/03/2013                 
    DM_20                       933                         24/03/2013                  Top 11 QTD of DOMAIN_NAME per Data Range.
    SELECT *
    FROM
      (SELECT DOMAIN_NAME,
        QTD,
        LOAD_DATE
      FROM
        (SELECT LOAD_DATE,
          DOMAIN_NAME ,
          QTD,
          (DENSE_RANK() OVER (PARTITION BY LOAD_DATE ORDER BY QTD DESC )) AS RANK_QTD
        FROM SAMPLE_DATA
        WHERE trunc(load_date) BETWEEN '24/03/2013' AND '25/03/2013'
      WHERE RANK_QTD <= 10
      UNION ALL
      SELECT 'Others',
        SUM(QTD) AS QTD,
        LOAD_DATE
      FROM
        (SELECT LOAD_DATE,
          DOMAIN_NAME ,
          QTD,
          (DENSE_RANK() OVER (PARTITION BY LOAD_DATE ORDER BY QTD DESC )) AS RANK_QTD
        FROM SAMPLE_DATA
        WHERE trunc(load_date) BETWEEN '24/03/2013' AND '25/03/2013'
      WHERE RANK_QTD > 10
      GROUP BY LOAD_DATE
    ORDER BY LOAD_DATE ASC,
      QTD DESC
    DOMAIN_NAME                 QTD                         LOAD_DATE                  
    Others                      2888                        24/03/2013                 
    DM_1                        1000                        24/03/2013                 
    DM_20                       933                         24/03/2013                 
    DM_11                       913                         24/03/2013                 
    DM_3                        743                         24/03/2013                 
    DM_13                       572                         24/03/2013                 
    DM_12                       568                         24/03/2013                 
    DM_9                        564                         24/03/2013                 
    DM_6                        505                         24/03/2013                 
    DM_5                        504                         24/03/2013                 
    DM_2                        480                         24/03/2013                 
    Others                      1948                        25/03/2013                 
    DM_1                        807                         25/03/2013                 
    DM_8                        764                         25/03/2013                 
    DM_7                        761                         25/03/2013                 
    DM_11                       656                         25/03/2013                 
    DM_18                       611                         25/03/2013                 
    DM_17                       523                         25/03/2013                 
    DM_14                       467                         25/03/2013                 
    DM_19                       447                         25/03/2013                 
    DM_15                       437                         25/03/2013                 
    DM_6                        380                         25/03/2013 

  • Can not set data range for a numerical control

    I want to set the maximum of data range to 5000, but it always went back to default value of 127.
    WHy I can not change the data range? Thanka for explanations.
    Message Edited by Dejun on 11-14-2007 11:47 PM
    Attachments:
    datarange.jpg ‏74 KB

    So hit the 'Representation' button.
    Ton
    Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
    Nederlandse LabVIEW user groep www.lvug.nl
    My LabVIEW Ideas
    LabVIEW, programming like it should be!

  • Need help to join two tables using three joins, one of which is a (between) date range.

    I am trying to develop a query in MS Access 2010 to join two tables using three joins, one of which is a (between) date range. The tables are contained in Access. The reason
    the tables are contained in access because they are imported from different ODBC warehouses and the data is formatted for uniformity. I believe this cannot be developed using MS Visual Query Designer. I think writing a query in SQL would be suiting this project.
    ABCPART links to XYZPART. ABCSERIAL links to XYZSERIAL. ABCDATE links to (between) XYZDATE1 and ZYZDATE2.
    [ABCTABLE]
    ABCORDER
    ABCPART
    ABCSERIAL
    ABCDATE
    [ZYXTABLE]
    XYZORDER
    XYZPART
    XYZSERIAL
    XYZDATE1
    XYZDATE2

    Thank you for the looking at the post. The actual table names are rather ambiguous. I renamed them so it would make more sense. I will explain more and give the actual names. What I do not have is the actual data in the table. That is something I don't have
    on this computer. There are no "Null" fields in either of the tables. 
    This table has many orders (MSORDER) that need to match one order (GLORDER) in GLORDR. This is based on MSPART joined to GLPART, MSSERIAL joined to GLSERIAL, and MSOPNDATE joined if it falls between GLSTARTDATE and GLENDDATE.
    [MSORDR]
    MSORDER
    MSPART
    MSSERIAL
    MSOPNDATE
    11111111
    4444444
    55555
    2/4/2015
    22222222
    6666666
    11111
    1/6/2015
    33333333
    6666666
    11111
    3/5/2015
    This table has one order for every part number and every serial number.
    [GLORDR]
    GLORDER
    GLPART
    GLSERIAL
    GLSTARTDATE
    GLENDDATE
    ABC11111
    444444
    55555
    1/2/2015
    4/4/2015
    ABC22222
    666666
    11111
    1/5/2015
    4/10/2015
    AAA11111
    555555
    22222
    3/2/2015
    4/10/2015
    Post Query table
    GLORDER
    MSORDER
    GLSTARTDATE
    GLENDDATE
    MSOPNDATE
    ABC11111
    11111111
    1/2/2015
    4/4/2015
    2/4/2015
    ABC22222
    22222222
    1/5/2015
    4/10/2015
    1/6/2015
    ABC22222
    33333333
    1/5/2015
    4/10/2015
    3/5/2015
    This is the SQL minus the between date join.
    SELECT GLORDR.GLORDER, MSORDR.MSORDER, GLORDR.GLSTARTDATE, GLORDR.GLENDDATE, MSORDR.MSOPNDATE
    FROM GLORDR INNER JOIN MSORDR ON (GLORDR.GLSERIAL = MSORDR.MSSERIAL) AND (GLORDR.GLPART = MSORDR.MSPART);

  • No Data in Reports Details in Custom date range

    Hello, iTunes U Public Site Manager Admins.
    As the iTunes U Public Site Manager admin, I've been trying to access our institution's iTunes U Reports Details for a couple of days. (I send a monthly report of usage to our course/collection contributors.) When I custom the date range, under Details, there is zero entry; "No data available in table" message is shown.
    This feature had been working well since Apple iTunes U added this enhancement on August 13, 2013. The report Details showed the exact stats for Browse, Subscribe, Download, Stream, and Enclosure for each course/collection in the custom date range.
    Now under "Details", the data is shown only when the date range is Last 30 Days. It shows no data in custom date range when the Calendar is used to select a Start Date and End Date.
    Has anyone else noticed this problem?
    Thanks.
    Q. Wang

    Erik.
    I used your suggestion and it worked very well. This is how I did it.
    Export the range of data that includes Feb. 1-Feb. 28, 2014 as .tsv file.
    Open that file in Excel.
    Add a blank column next to the Date column. Use function =Month() to just extract the month into the new column. Fill down the whole column. Then copy and paste special (value) into the same column (I have over 26,000 rows of data in the file.) Converting to Value will allow for the next step of PivotTable.
    Create a PivotTable for the 26,000 rows of data. Use Month as the Report filter, iTunes_ID as the Row Labels, Select Browse, Subscribe, etc. as the Sum Values. (The result is a summary table with about 200 rows.)
    I then do a Vlookup to my premade Master file to add Category (course, collection, resources) and Instructor Name to each of the 200 rows.
    That will do it for my monthly report.
    Thanks for your tip again. I did not know the .tsv file would have DATE for each item.
    Sincerely,
    Q. Wang

  • Continious data range algorithm

    I have in my database table 2 important date columns: StartDate (Not null) and EndDate(Allowed Null).
    I want to ensure that all records in the table would always create perfect contiues date ranges with no holes inside.
    Wor example there may not be records [1-may..1-may, 3-may-...] because there would be a hole [2-may...2-may]. Holes are not allowed.
    And overlapping is not allowed, for example [1-may..1-may, 1-may-2may, 3-may-...] is not allowed because overlapping occures on day 1-may. Overlapping and holes are not allowed. But it is allowed that table has no records at all. But all DML manipulations with existing records must ensure that overlapping and holes won't occur.
    How to write such check? How to ensure that data ranges would stay continous with no holes and no overlaps?
    Oracle 11g.

    You're setting the wrong value for the start of a group when there is no (null) lagging end date. In my example I set the value to 0 when it was null as I was expecting each group to start at 1. In your case you've set the date to 1/1/1900 which isn't necessarily the day before the first start date of the group. Instead just default it to the start date - 1 to force a match...
    SQL> ed
    Wrote file afiedt.buf
      1  with t as (select 1 as id, to_date('01.04.2013', 'DD.MM.YYYY') as val1, to_date('04.04.2013', 'DD.MM.YYYY') as val2 from dual union all
      2             select 1, to_date('05.04.2013', 'DD.MM.YYYY'), to_date('06.04.2013', 'DD.MM.YYYY') from dual union all
      3             select 1, to_date('07.04.2013', 'DD.MM.YYYY'), null from dual union all
      4             select 2, to_date('01.04.2013', 'DD.MM.YYYY'), to_date('03.04.2013', 'DD.MM.YYYY') from dual union all
      5             select 2, to_date('04.04.2013', 'DD.MM.YYYY'), to_date('07.04.2013', 'DD.MM.YYYY') from dual union all
      6             select 2, to_date('09.04.2013', 'DD.MM.YYYY'), to_date('12.04.2013', 'DD.MM.YYYY') from dual union all
      7             select 2, to_date('13.04.2013', 'DD.MM.YYYY'), null from dual union all
      8             select 3, to_date('01.04.2013', 'DD.MM.YYYY'),to_date('03.04.2013', 'DD.MM.YYYY') from dual union all
      9             select 3, to_date('04.04.2013', 'DD.MM.YYYY'), null from dual union all
    10             select 4, to_date('01.04.2013', 'DD.MM.YYYY'), to_date('01.04.2013', 'DD.MM.YYYY') from dual union all
    11             select 4, to_date('01.04.2013', 'DD.MM.YYYY'), null from dual
    12            )
    13  --
    14  select id
    15        ,val1 as "start"
    16        ,val2 as "end"
    17        ,lag(val2) over (partition by id order by val1)
    18        ,case when
    19             nvl(lag(val2) over (partition by id order by val1),val1-1) != val1-1 then
    20                   'hole or overlap'
    21              else null
    22         end as chk
    23  from t
    24* order by 1, 2
    25  /
            ID start                end                  LAG(VAL2)OVER(PARTIT CHK
             1 01-APR-2013 00:00:00 04-APR-2013 00:00:00
             1 05-APR-2013 00:00:00 06-APR-2013 00:00:00 04-APR-2013 00:00:00
             1 07-APR-2013 00:00:00                      06-APR-2013 00:00:00
             2 01-APR-2013 00:00:00 03-APR-2013 00:00:00
             2 04-APR-2013 00:00:00 07-APR-2013 00:00:00 03-APR-2013 00:00:00
             2 09-APR-2013 00:00:00 12-APR-2013 00:00:00 07-APR-2013 00:00:00 hole or overlap
             2 13-APR-2013 00:00:00                      12-APR-2013 00:00:00
             3 01-APR-2013 00:00:00 03-APR-2013 00:00:00
             3 04-APR-2013 00:00:00                      03-APR-2013 00:00:00
             4 01-APR-2013 00:00:00 01-APR-2013 00:00:00
             4 01-APR-2013 00:00:00                      01-APR-2013 00:00:00 hole or overlap
    11 rows selected.

  • Report for open invoice value against GR done within a date range

    Dear experts ,
    I need a report  between date ranges for which there is a GR done , but invoice is pending .
    Where can i get this ? 
    Regards
    Anis

    hi,
    You can  check few default PO reports wid proper paramater in it
    or
    Can check table EKBE
    or
    Check PO history in the PO doc
    Or
    Check the ME80FN
    Regards
    Priyanka.P

  • Devolped an ALV report for daily cash receipts for selected date range

    hi,   
                 how to devlop an ALV report for daily cash receipts for selected date range.for this report what are the tables and fields we have to use.what is the selectionscreen&what is logic.give me sample report.

    hi,   
                 how to devlop an ALV report for daily cash receipts for selected date range.for this report what are the tables and fields we have to use.what is the selectionscreen&what is logic.give me sample report.

  • Devloped an ALV report for daily cash receipts for selected date range

    hi,   
                 how to devlop an ALV report for daily cash receipts for selected date range.for this report what are the tables and fields we have to use.what is the selectionscreen&what is logic.give me sample report.

    Hi,
    You can develop simple reports using Report Painter.
    You may be also interested in:
    Check report SAPMF05A for credit memo
    See the following Std reports on Payment Advices execute the Tcodes:
    S_ALR_87009888
    S_ALR_87009889
    S_ALR_87009890
    S_ALR_87009891
    S_ALR_87009892
    S_ALR_87009893
    S_ALR_87009978
    S_ALR_87009979
    S_ALR_87009980
    S_ALR_87009981
    S_ALR_87009982
    S_ALR_87009983
    S_ALR_87010056
    S_ALR_87010057
    S_ALR_87010058
    S_ALR_87010059
    S_ALR_87010060
    S_ALR_87010061
    S_ALR_87010066
    S_ALR_87010067
    S_ALR_87012106
    S_ALR_87012107
    S_ALR_87012108
    S_ALR_87012109
    S_ALR_87012110
    S_ALR_87012111
    S_ALR_87012116
    S_ALR_87012117
    S_ALR_87012200
    S_ALR_87012201
    S_ALR_87012202
    S_ALR_870122
    S_ALR_87012204
    S_ALR_87012205
    S_ALR_87012350
    S_ALR_87012351
    S_ALR_87012352
    S_ALR_87012353
    S_ALR_87012354
    S_ALR_87012355
    sample ALV report:
    tables:
    marav. "Table MARA and table MAKT
    Data to be displayed in ALV
    Using the following syntax, REUSE_ALV_FIELDCATALOG_MERGE can auto-
    matically determine the fieldstructure from this source program
    Data:
    begin of imat occurs 100,
    matnr like marav-matnr, "Material number
    maktx like marav-maktx, "Material short text
    matkl like marav-matkl, "Material group (so you can test to make
                            " intermediate sums)
    ntgew like marav-ntgew, "Net weight, numeric field (so you can test to
                            "make sums)
    gewei like marav-gewei, "weight unit (just to be complete)
    end of imat.
    Other data needed
    field to store report name
    data i_repid like sy-repid.
    field to check table length
    data i_lines like sy-tabix.
    Data for ALV display
    TYPE-POOLS: SLIS.
    data int_fcat type SLIS_T_FIELDCAT_ALV.
    select-options:
    s_matnr for marav-matnr matchcode object MAT1.
    start-of-selection.
    read data into table imat
      select * from marav
      into corresponding fields of table imat
      where
      matnr in s_matnr.
    end-of-selection.
    Now, we start with ALV
    To use ALV, we need a DDIC-structure or a thing called Fieldcatalogue.
    The fieldcatalouge can be generated by FUNCTION
    'REUSE_ALV_FIELDCATALOG_MERGE' from an internal table from any
    report source, including this report.
    The only problem one might have is that the report and table names
    need to be in capital letters. (I had it )
    Store report name
    i_repid = sy-repid.
    Create Fieldcatalogue from internal table
      CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
           EXPORTING
                I_PROGRAM_NAME         = sy-repid
                I_INTERNAL_TABNAME     = 'IMAT'  "capital letters!
                I_INCLNAME             = sy-repid
           CHANGING
                CT_FIELDCAT            = int_fcat
           EXCEPTIONS
                INCONSISTENT_INTERFACE = 1
                PROGRAM_ERROR          = 2
                OTHERS                 = 3.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
           EXPORTING
                I_CALLBACK_PROGRAM       = i_repid
                I_STRUCTURE_NAME         = 'marav'
                I_DEFAULT                = 'X'
                I_SAVE                   = 'A'
           TABLES
                T_OUTTAB                 = imat.
      IF SY-SUBRC <> 0.
        WRITE: 'SY-SUBRC: ', SY-SUBRC .
      ENDIF.
    Hope this will help.
    Regards,
    Naveen.

  • How to create a date range in Web Application Designer

    I am using 3.1 version of Web App Designer.  I need to create a report with date ranges.  I can get one date to work but not two (I need a start date and end Date).  My Query has 0CALMONTH with a variable for Interval.  When I select it as a dropdown (??) in Web App Designer, I only get one date prompt in web app designer.
    Any suggestions??
    Thanks
    Kristen

    Hi Kristen,
    I'm sorry i'm not coming to solve your problem,but for the trouble I have had,and I want to create a date picker in Web Application Designer,so if you have solved the problem ,please email to me? [email protected] ,thx very much!
    best regards
    zegion chan

Maybe you are looking for

  • I have AT&T & Curve 8300 running BIS - Can I upgrade-

    to version 2.5 of the device firmware along with the companion v4.5 or 4.6 desktop software? Here's a little background: I bought my Curve last fall at an AT&T store.  I had been a quite satisfied Palm customer since 1994 and so had accumulated over

  • Getting ORA-01031 in Log file

    Hi All, I registered my custom procedure as Concurrent Program in Oracle Apps. While I am running Oracle Concurrent Program, I am getting below in Log file an immediately Concurrent Managers are shut down, and is in "Running State" always. Enabled Tr

  • Is there any restrictio​n in designing labview model for veristand

    Hi, I developed the labview model with cluster, cluster attribute(i am accessing the cluster label text , value in the model), loops, shift register. The model works fine in a standalone labview environment. Then i converted to .lvmodel and attached

  • Process flow: validation error: VLD-10010

    OWB 10.2 process flow: I simply put a mapping in a process flow between the START and END activity and want to validate it. But I get the error: "VLD-10010: MAP_TEMP_POS's bound object null of type null?? has been deleted." The mapping itself is alre

  • Old 3D Dreams Xtras

    Hello, everyone! I'm trying to get an old (1999) .dcr to work. I've got all the Xtras it needs except for two called thus: 3DDreams.x32 3ddplay.x32 These are old 3D (Pre-Shockwave3DAsset) Xtras called "Shells Interactive's 3D Dreams Player". They wer