Chart Query problem

Hi all ,
I am a newbie to Oracle apex and have stuck in an issue . I am using this query for my Chart Source
select NULL link, count() Count VALUE , to_char((TRUNC(ORDER_DATE)),'Month') "Month"*
from  "HR"."OEHR_ORDERS"
group by to_char((TRUNC(ORDER_DATE)),'Month')
order by 1 desc
but it gives this error when i click next
1 error has occurred
Failed to parse SQL query!
select NULL link, count() Count VALUE , to_char((TRUNC(ORDER_DATE)),'Month') "Month" from "HR"."OEHR_ORDERS" group by to_char((TRUNC(ORDER_DATE)),'Month') order by 1 desc*
Certain queries can only be executed when running your application, if your query appears syntactically correct, you can save your query without validation (see options below query source).
what should i do and what am i doing wrong ? as this query gives the correct result if i run it in SQL window
thanks for the help in advance

In your first query, you gave the count(*) column two names COUNT and Value. That I think was your only mistake.
The column ordering might not matter if you only have one value column, but if you want a single chart query to represent more than one line, then the ordering matters.
In my application I use an Apex item to hold the entire query as text, including v(...) bindings, and displays 1 to 50 lines, dynamically depending on the number of value columns. The names of the lines are derived from the column names.
/kenny

Similar Messages

  • Legend needs to display Prompt values / Remove filters from chart query

    Hi
    I have 2 questions for the same chart so I hope it's OK to add them in one post.
    Firstly I have created a chart & added three Select List filters which work fine, the query is below, problem is that when I change back to '-ALL-' I get no data, it has filtered out all records as no data matches the value of '-ALL-' does anyone know the code to get around this?
    My chart query;
    select null link, P_MONTH AS MONTH, SUM(CALLS) AS data
    from DATA.MAIN_DATA
    WHERE WAREHOUSE = :P1_WAREHOUSE
    AND ANS_UNANS = :P1_ANS_UNANS
    AND PRODUCT = :P1_PRODUCT
    GROUP BY P_MONTH
    As I will have several queries like the one above for different options on the same chart, I would like the Legend to show what the user has chosen each time the options are changed ie;
    Something like the bolded text in the query to display the chosen values in the legend;
    select null link, P_MONTH AS MONTH, SUM(CALLS) AS *'P1_WAREHOUSE' || 'P1_ANS_UNANS' || 'P1_PRODUCT'*
    from DATA.MAIN_DATA
    WHERE WAREHOUSE = :P1_WAREHOUSE
    AND ANS_UNANS = :P1_ANS_UNANS
    AND PRODUCT = :P1_PRODUCT
    GROUP BY P_MONTH
    Any ideas/suggests?

    Woof777 wrote:
    Any ideas/suggests?Try the APEX forum ;)

  • Unable to edit wizard created SVG chart query

    Hi,
    I have a problem with an SVG chart that one of the HTML DB wizards created.
    On the generated page the wizard created a selection list item named P30_SHOW.
    This item allows to choose a table column based on which an SVG pie chart is generated.
    The automatically generated chart query is:
    select 'f?p=106:26:&SESSION.:::RP,26:P26_CHART_FILTER,P26_VALUE:'||:P30_SHOW||','||"&P30_SHOW.",
    "&P30_SHOW.", count(*)
    from "TESTTABLE"
    group by 'f?p=106:26:&SESSION.:::RP,26:P26_CHART_FILTER,P26_VALUE:'||:P30_SHOW||','||"&P30_SHOW.",
    "&P30_SHOW."
    The page with selection list and chart worked fine at first.
    But then, when I edited the chart's width on the respective 'SVG Chart Attributes' tab and pressed
    the 'Apply Changes' button I got the following error:
    'Query cannot be parsed, please check the syntax of your query. (ORA-01741: illegal zero-length identifier)'
    I only changed the chart's width, I did not touch the chart's query at all.
    My theory is that HTML DB tries to validate the correctness of the chart's query.
    However, the query references a session variable (P30_SHOW) that is
    not defined in my development session. Consequently, the query is not valid in the
    development context and is refused by HTML DB.
    Now I have two questions:
    1. Is my analysis correct, or are there different reasons for the error I do encounter?
    2. How can I get around the problem? I'd like to use the automatically generated charts,
    but also want to be able to edit them.
    Thanks in advance for helpful comments.
    Regards Holger

    Scott,
    I imported the application using the import/install process. A new application ID was created but was not changed in the chart query. The link was generated by the application wizard. The chart query link is below:
    select 'f?p=103:2:&SESSION.:::RP,2:P2_CHART_FILTER,P2_VALUE:'||:P6_SHOW||','||"&P6_SHOW.", "&P6_SHOW.", count(*)
    from "O_DATA_COLLECTION_POINTS"
    group by 'f?p=103:2:&SESSION.:::RP,2:P2_CHART_FILTER,P2_VALUE:'||:P6_SHOW||','||"&P6_SHOW.", "&P6_SHOW."
    The new application id is 101. It is impossible to modify this query because of message:
    "1 error has occurred
    Query cannot be parsed, please check the syntax of your query. (ORA-01741: illegal zero-length identifier"
    This happens even if nothing is changed in the query but just the apply changes button is pressed.
    I had a similar problem with the breadcrumbs menu. The link was also pointing to the old application id 103 instead of the new application id 101. The way I got round that was to delete the breadcrumb template and create a new one. I then had to go through all the pages that referenced that and reset the breadcrumbs menu template in the region definition.
    Thanks Arjen

  • Chart Query and Failed to parse SQL query

    Hi,
    first of all, this is not a question. It is a reminder for me and maybe for someone with the same problem.
    I just fell over this for the 123124 time.
    I have a 3D Chart Query
    select sum(order_ok) value,
          count(*) maximum_value
    from      v_dialer_campaign
    where campaign_uuid = :P300_CAMPAIGN_IDSaving fails with
    "1 error has occurred Failed to parse SQL query!" ...
    Saving the query without validation works, but does not show any result in the chart.
    v_dialer_campaign is a view selecting from a view in a mssql db over database link and HS.
    running the select in sqlplus or toad works.
    Without any trace on freetds/unixodb/hs side, i would have not found the following line:
    [FreeTDS][SQL Server]The data types nvarchar and text are incompatible in the equal to operator.[FreeTDS][SQL Server]Statement(s) could not be prepared.
    Solution:
    with q as (select :P300_CAMPAIGN_ID val from dual)
    select     sum(order_ok) value,
         count(*) maximum_value
    from     v_dialer_campaign
    where     campaign_uuid in ( select val from q)Maybe the error output when validating the query should be included in the APEX error message.
    Same solution applies for dynamic LOV's reading from HS using a where clause.

    I tried your first query on Apex 3.2 and it created a nice dial chart.
    Is there any ORA-xxxxx error along with the "failed to parse SQL query" message? Did you double check column & table name spelling?
    P.S. The second query is invalid (a superfluous comma after the second column).

  • Gantt Chart Related Problem

    Project Link:
    PPPM
    How to solve these problems.
    Problem 1:
    I have to scroll both the Gantt Chart and Task List scroll
    simultaneously. When i scroll Gantt Chart , then at the same time
    Task List and vice versa.
    Problem 2:
    How to stop Gantt Chart header movement stop when scroll the
    Gantt Chart.
    Problem 3:
    In the Gantt Chart Node, there are 2 section. One is dark
    section and other is lite section. I have to slide these scctions
    like like HDevidedBox effect.
    Please help me out from these problems.

    Hi Vedant,
    values are displayed in pie chart their label is not display.
    So you're able to view the value and label information when you hover over a slice i.e. viewing the tooltip, but you can't see the actual label for each slice of the pie. If you're not seeing all of the labels for the slices of the Pie chart, then this could due to a couple of reasons:
    1) the length of the label
    2) the position of the label
    3) the size of the chart
    Keep in mind that displaying all 41 labels on the chart could result in an extremely cluttered looking chart. AnyChart controls the visibility of the labels, depending on the above factors. So if your labels are quite lengthy, for example, and they are positioned to be displayed outside the chart, then AnyChart will display what labels it can for the given chart size. To work around this, having tooltips enabled is a good starting point. Alternatively, you could look at decreasing the length of the label text, changing the label position or even increasing the size of the chart. For further information on the label formatting, I would recommend reviewing AnyChart's online documentation, here: http://anychart.com/products/anychart/docs/users-guide/label-text-formatting.html?fromtree.
    Regards,
    Hilary

  • Bubble chart legend problem

    Hello.
    I have problem with bubble chart the problem is that in chart legend appear the same number of object what bubble in chart e.g. if chart have 5 bubble then legend also have 5 object.
    What do I want to obtain is that in chart appear bubble which have different color (color depends on condition) and legend relate only colors. For example if chart have 4 bubble 3 - red and 1 - green then in legend appear only two position which relate green and red color (now appear 4 object three about red and one green).
    Can any one tell me how to resolve this problem?

    I already did this I added three condition (three colors red, green and yellow) in field "Value of" I choosed "is equal to" unfortunately it didn't help.
    Maybe I joust try to describe what I want to show in this chart.
    Suppose I have table with four columns u201Cdateu201D, u201Camount (number type)u201D, u201Csize (number type)u201D, u201Crisku201D (text type) now where this value appear on chart:
    - date is x axis
    - amount is y axis
    - size is a bubble size
    - risk will be bubble color
    Now I have 3 kind of risk u201CLowu201D (green color), u201CMediumu201D (yellow color) and u201CHighu201D (red color).
    Now in my data base I have table with record:
    - u201C11-11-2009u201D, u201C1u201D, u201C2u201D, u201CMediumu201D
    - u201C12-11-2009u201D, u201C2u201D, u201C1u201D, u201CMediumu201D
    - u201C13-11-2009u201D, u201C1u201D, u201C1u201D, u201CHighu201D
    - u201C14-11-2009u201D, u201C3u201D, u201C3u201D, u201CLowu201D
    - u201C15-11-2009u201D, u201C1u201D, u201C1u201D, u201CLowu201D
    Ok so now In My chart I should have 5 bubble and in legend three value (green, red, yellow) but in this case I always have five (the same number what record in table).
    Sorry if this example is not clear.

  • Designing LOV Query Problem

    Hello APEX people,
    I posted my problem here:
    Designing LOV Query Problem
    What I have is a sequence like this:
    CREATE SEQUENCE
    DR_SEQ_FIRST_SCHEDULE_GROUP
    MINVALUE 1 MAXVALUE 7 INCREMENT BY 1 START WITH 1
    CACHE 6 ORDER CYCLE ;
    What I need would be a SQL query returning all possible values oft my sequence like:
    1
    2
    3
    4
    5
    6
    7
    I want to use it as a source for a LOV...
    The reason why I use the cycling sequence is: My app uses it to cycle scheduling priorities every month to groups identified by this number (1-7).
    In the Admin Form, I want to restrict the assignment in a user friendly way - a LOV.
    Thanks
    Johann

    Here ist the solution (posted by michales in the PL/SQL forum):
    SQL> CREATE SEQUENCE
    dr_seq_first_schedule_group
    MINVALUE 1 MAXVALUE 7 INCREMENT BY 1 START WITH 1
    CACHE 6 ORDER CYCLE
    Sequence created.
    SQL> SELECT LEVEL sn
    FROM DUAL
    CONNECT BY LEVEL <= (SELECT max_value
    FROM user_sequences
    WHERE sequence_name = 'DR_SEQ_FIRST_SCHEDULE_GROUP')
    SN
    1
    2
    3
    4
    5
    6
    7
    7 rows selected.

  • SQL+-MULTI TABLE QUERY PROBLEM

    HAI ALL,
    ANY SUGGESTION PLEASE?
    SUB: SQL+-MULTI TABLE QUERY PROBLEM
    SQL+ QUERY GIVEN:
    SELECT PATIENT_NUM, PATIENT_NAME, HMTLY_TEST_NAME, HMTLY_RBC_VALUE,
    HMTLY_RBC_NORMAL_VALUE, DLC_TEST_NAME, DLC_POLYMORPHS_VALUE,
    DLC_POLYMORPHS_NORMAL_VALUE FROM PATIENTS_MASTER1, HAEMATOLOGY1,
    DIFFERENTIAL_LEUCOCYTE_COUNT1
    WHERE PATIENT_NUM = HMTLY_PATIENT_NUM AND PATIENT_NUM = DLC_PATIENT_NUM AND PATIENT_NUM
    = &PATIENT_NUM;
    RESULT GOT:
    &PATIENT_NUM =1
    no rows selected
    &PATIENT_NUM=2
    no rows selected
    &PATIENT_NUM=3
    PATIENT_NUM 3
    PATIENT_NAME KKKK
    HMTLY_TEST_NAME HAEMATOLOGY
    HMTLY_RBC_VALUE 4
    HMTLY_RBC_NORMAL 4.6-6.0
    DLC_TEST_NAME DIFFERENTIAL LEUCOCYTE COUNT
    DLC_POLYMORPHS_VALUE     60
    DLC_POLYMORPHS_NORMAL_VALUE     40-65
    ACTUAL WILL BE:
    &PATIENT_NUM=1
    PATIENT_NUM 1
    PATIENT_NAME BBBB
    HMTLY_TEST_NAME HAEMATOLOGY
    HMTLY_RBC_VALUE 5
    HMTLY_RBC_NORMAL 4.6-6.0
    &PATIENT_NUM=2
    PATIENT_NUM 2
    PATIENT_NAME GGGG
    DLC_TEST_NAME DIFFERENTIAL LEUCOCYTE COUNT
    DLC_POLYMORPHS_VALUE     42
    DLC_POLYMORPHS_NORMAL_VALUE     40-65
    &PATIENT_NUM=3
    PATIENT_NUM 3
    PATIENT_NAME KKKK
    HMTLY_TEST_NAME HAEMATOLOGY
    HMTLY_RBC_VALUE 4
    HMTLY_RBC_NORMAL 4.6-6.0
    DLC_TEST_NAME DIFFERENTIAL LEUCOCYTE COUNT
    DLC_POLYMORPHS_VALUE     60
    DLC_POLYMORPHS_NORMAL_VALUE     40-65
    4 TABLES FOR CLINICAL LAB FOR INPUT DATA AND GET REPORT ONLY FOR TESTS MADE FOR PARTICULAR
    PATIENT.
    TABLE1:PATIENTS_MASTER1
    COLUMNS:PATIENT_NUM, PATIENT_NAME,
    VALUES:
    PATIENT_NUM
    1
    2
    3
    4
    PATIENT_NAME
    BBBB
    GGGG
    KKKK
    PPPP
    TABLE2:TESTS_MASTER1
    COLUMNS:TEST_NUM, TEST_NAME
    VALUES:
    TEST_NUM
    1
    2
    TEST_NAME
    HAEMATOLOGY
    DIFFERENTIAL LEUCOCYTE COUNT
    TABLE3:HAEMATOLOGY1
    COLUMNS:
    HMTLY_NUM,HMTLY_PATIENT_NUM,HMTLY_TEST_NAME,HMTLY_RBC_VALUE,HMTLY_RBC_NORMAL_VALUE     
    VALUES:
    HMTLY_NUM
    1
    2
    HMTLY_PATIENT_NUM
    1
    3
    MTLY_TEST_NAME
    HAEMATOLOGY
    HAEMATOLOGY
    HMTLY_RBC_VALUE
    5
    4
    HMTLY_RBC_NORMAL_VALUE
    4.6-6.0
    4.6-6.0
    TABLE4:DIFFERENTIAL_LEUCOCYTE_COUNT1
    COLUMNS:DLC_NUM,DLC_PATIENT_NUM,DLC_TEST_NAME,DLC_POLYMORPHS_VALUE,DLC_POLYMORPHS_
    NORMAL_VALUE,
    VALUES:
    DLC_NUM
    1
    2
    DLC_PATIENT_NUM
    2
    3
    DLC_TEST_NAME
    DIFFERENTIAL LEUCOCYTE COUNT
    DIFFERENTIAL LEUCOCYTE COUNT
    DLC_POLYMORPHS_VALUE
    42
    60
    DLC_POLYMORPHS_NORMAL_VALUE
    40-65
    40-65
    THANKS
    RCS
    E-MAIL:[email protected]
    --------

    I think you want an OUTER JOIN
    SELECT PATIENT_NUM, PATIENT_NAME, HMTLY_TEST_NAME, HMTLY_RBC_VALUE,
    HMTLY_RBC_NORMAL_VALUE, DLC_TEST_NAME, DLC_POLYMORPHS_VALUE,
    DLC_POLYMORPHS_NORMAL_VALUE
    FROM PATIENTS_MASTER1, HAEMATOLOGY1,  DIFFERENTIAL_LEUCOCYTE_COUNT1
    WHERE PATIENT_NUM = HMTLY_PATIENT_NUM (+)
    AND PATIENT_NUM = DLC_PATIENT_NUM (+)
    AND PATIENT_NUM = &PATIENT_NUM;Edited by: shoblock on Nov 5, 2008 12:17 PM
    outer join marks became stupid emoticons or something. attempting to fix

  • Flash Chart Legend Problem

    Hi,
    Im having a problem with my flash chart legends in Apex3.0.
    I have changed the name of the Series to what i want to appear in my legend - however the legend just shows "Value" for all my Series.
    Does anyone else have this problem?
    Cheers,
    Immanuel

    Hello,
    I need a legend like this
    No of Clicks('000)
    If i give l" No of Clicks('000)" as column alias, chart says Error :No chart data available.
    If i give "No of Clicks('000')" or "No of Clicks(''000)" as column alias in the query, it displays the correct legend..
    Would anybody tell me how to show the legend like this
    No of Clicks('000)
    Regards,
    Archana

  • How to use Item value in chart query

    Hi Folks,
    I am looking to use calander item value in sql query used to populate flash chart. I tried with following query where P2_DATE1 is the calander item name. This says no data found. I am not sure if I am missing some thing with BUTTON settings which I am using to put data into chart.
    Select null "link",to_date(entry_date,'dd-mon-yy hh:mi:ss') "Time in GMT", to_number(load_avg_5,'99.99') "Load Avg 5 Min" from oracle_ocm.top_load_avg --where trunc(entry_date)=:P2_DATE1
    I am new to APEX
    Please help

    Here are few things for you to try:
    Hardcode the value and see if it works. "where trunc(entry_date) = to_date('01-May-2010', 'dd-Mon-yyyy')". If it works, then click Session link at the bottom of the page, and check the value of the item P2_DATE1. If null, then you have a problem. If not null, please ensure that you use TO_DATE function as shown above with proper format mask.
    Good luck.
    Ravi A

  • Stacked Bar Chart Query

    Hello everyone,
    I need some help on a query for a Stacked Bar Chart.
    I copied the following query from the "How To" Pages for a Stacked Bar (HTML DB 2 Day Developer) and adjusted it according to my tables:
    SELECT NULL l,
    sales_month,
    revenue
    FROM (
    SELECT TO_CHAR(o.order_timestamp,'Mon YYYY') sales_month,
    SUM(oi.quantity * oi.unit_price) revenue,
    TO_DATE(to_char(o.order_timestamp,'Mon YYYY'),'Mon YYYY') sales_month_order
    FROM DEMO_PRODUCT_INFO p,
    DEMO_ORDER_ITEMS oi,
    DEMO_ORDERS o
    WHERE o.order_timestamp <= (trunc(sysdate,'MON')-1)
    AND o.order_timestamp > (trunc(sysdate-365,'MON'))
    AND o.order_id = oi.order_id
    AND oi.product_id = p.product_id
    AND p.category = 'Phones'
    GROUP BY TO_CHAR(o.order_timestamp,'Mon YYYY')
    ORDER BY sales_month_order
    The problem now that I have is, that the results are not always correct.
    That means, that the numbers for every month that has 31 days is incorrect.
    I created a chart for 2005 and the numbers for Jan, March, May, July and so on are wrong. I found out that they always include numbers from the next (first) day of the next month, that means that the January number contains the numbers from the 1st of February, that March number contains the numbers of the 1st of April and so on. The only difference of my query is that I did not use a timestamp but rather a date. Can someone tell me what to do to solve the problem without changing the column to timestamp? I assume it has something to do with rounding up or "truncating" the date!?
    I appreciate your help!!

    Is there nobody out there, how might give me a hint ?? :-(

  • Please help with chart query

    Hello, i am trying to display a line chart, for some sales data.
    I want a line (series) for each product, X axis should be the years in the data
    (2007, 2008, 2009 there is no more data than these years)
    The plan is to eventually use a "Function Returning SQL Query" to get dynamic series.
    But i tried to hardcode 2 lines for 2 products first to try it out.
    I used this query in SQL Workshop > SQL Commands
    to view the data i want and it works correctly
    Query1:
    SELECT product.major_brand, timeperiod.year, SUM(sales_fact.euro_sales) AS sales
    FROM sales_fact
    INNER JOIN product ON sales_fact.product_id = product.product_id
    INNER JOIN timeperiod ON sales_fact.timeperiod_id = timeperiod.timeperiod_id
    GROUP BY product.major_brand, timeperiod.year
    ORDER BY product.major_brand, timeperiod.year ASCI have tried the following query for the chart but it will show 2 flat lines
    with the value 0 for each year.
    Query2:
    SELECT NULL
          ,timeperiod.year
          ,SUM(decode(product.major_brand, 'BELCINO', sales_fact.euro_sales, 0)) "BELCINO"
          ,SUM(decode(product.major_brand, 'BIORGANIC', sales_fact.euro_sales, 0)) "BIORGANIC"
    FROM sales_fact
    INNER JOIN product ON sales_fact.product_id = product.product_id
    INNER JOIN timeperiod ON sales_fact.timeperiod_id = timeperiod.timeperiod_id
    GROUP BY product.major_brand, timeperiod.yearThanks for reading,
    Any help is appreciated!
    Edited by: 908157 on 15-jan-2012 5:22
    Edited by: 908157 on 15-jan-2012 5:22

    Thanks Jeff for the quick response,
    I have looked at the examples, tried some things
    and found out that my GROUP BY was the problem.
    Apperantly i only have to GROUP BY on year and not also on product.
    I dont fully understand why yet,
    i guess the query gets parsed and translated to 2 queries, one for each line, that makes sense
    This is the query that worked for me:
    SELECT NULL
          ,t.year
          ,SUM(decode(p.major_brand, 'BELCINO', s.euro_sales, 0)) "BELCINO"
          ,SUM(decode(p.major_brand, 'BIORGANIC', s.euro_sales, 0)) "BIORGANIC"
    FROM sales_fact s, product p, timeperiod t
    WHERE s.product_id = p.product_id
    AND s.timeperiod_id = t.timeperiod_id
    GROUP BY t.year
    ORDER BY t.yearThanks again!

  • Chart Query

    Hi guys,
    I need to display the percentage of the total income of the company that each agent has made on a pie chart:
    I used this query, but the problem is that when I run the query on Sql workshop it works probably. but on the chart it does not show up the exact values
    select null link, agent label, round ( (SUM(total_comm) * 100 / (select sum(total_comm) sum_val from incomes)),2)
    PERCENTAGE from incomes group by agent
    LABEL     PERCENTAGE
    F_Mohammad     8.8
    A_Firas     12.8
    A_Elias     13.9
    B_Tarek     19.84
    Q_Ziad     4.7
    S_Bashar     6.69
    K_Jihad     11.92
    M_Tshepo     6.64
    M_Firas     .33
    I_Aamir     14.38On the chart it is how these values :
    F_Mohammad     3
    A_Firas     3
    A_Elias     6
    B_Tarek     8
    Q_Ziad     3
    S_Bashar     1
    K_Jihad     3
    M_Tshepo     2
    I_Aamir     3By the way, Perhaps someone can tell how can I put a table in the thread.
    I hope my Question is clear.
    Best Regards,
    Fateh
    Edited by: Fateh on Sep 3, 2011 3:00 AM

    Fateh,
    Try it this way:
    SELECT NULL                                               link,
           agent                                              label,
           Round (( SUM(total_comm) * 100 / sub.sum_val ), 2) percentage
    FROM   incomes,
           (SELECT SUM(total_comm) sum_val
            FROM   incomes) sub
    GROUP  BY agent   Jeff

  • JPA query problem

    Hi folks !
    I have this class with TemporalType.DATE property
    and i want to know if the query i design should look like this:
    select a from A a where a.dateProp = :theDateis this sufficient (where theDate should be substituted with a java.util.Date object with only the date,month,year set)?
    thanks

    Yes. In fact, the problem I've posted is a generalization of a more strange behaviur. The (cutted-off) schema is
    Table Charter
    id       integer   primary key
    company  integer   foreign key (on 'id' of table 'company')
    price    decimal
    Table Company
    id       integer   primary key
    name     textNow, assume I have 10 records in table Charter referencing 10 records in table Company (each row in Charter reference a distinct row in Company).
    This query returns me THE CORRECT RESULT (that is, each matching row is present in the result set only once):
    SELECT o FROM Charter AS o WHERE o.company.id = :company AND 1=1Instead, this query returns me each matching row, BUT REPEATED N TIMES, where N is the number of rows in Charter (10):
    SELECT o FROM Charter AS o WHERE 1=1 AND o.company.id = :company(Notice that the only difference is the order of the where clause)
    (Notice also that I get the same behaviour even if I do a query on the 'price' field).
    Also, this query that should return all the rows in the table (one time each), returns them N times:
    SELECT o FROM Charter AS o WHERE 1=1Any idea?
    Really thank you
    ps I forgot to say that, after translating those JPQL query in standard SQL and executing them in PostgreSQL console, they are, obiouvsly, equivalent and work correctly.
    Message was edited by:
    Konrad84

  • Reg: Query Problem for New Posting Period

    Hi Xperts,
    While I try to Map the A/P Invoices with their respective Outgoing Payment,
    I used the following Query and it's Query Printlayout
    SELECT T0.DocNum [Payment#], T0.DocDate [Payment Date],
    T0.CardCode, T0.CardName, T1.InvoiceId, T2.DocNum [AP Inv#],
    T2.NumatCard [Bill No.], T2.DocDate [Bill Date], T1.selfInv,
    T1.SumApplied, T1.WtAppld, T0.NoDocsum 
    FROM  [dbo].[OVPM] T0  INNER  JOIN
    [dbo].[VPM2] T1  ON  T1.[DocNum] = T0.DocNum
    INNER  JOIN [dbo].[OPCH] T2  ON  T2.[DocEntry] = T1.DocEntry
    WHERE T0.Cardname='[%0]' and T0.DocDate='[%1]' and
    T0.DocNum='[%2]'
    I got the above query from our Expert Mr.Sambath only.
    Now what is the problem is the query is retrieving the payment details of old Posting Period only and not the current posting period.
    In detail, I used 'Primary' Series for FY08-09, Period indicator 'Default'
    Now I'm using 'Primary1' Series for FY09-10, Period indicator '0910'
    Thanx in adv.
    Regards,
    Bala

    Hi Bala,
    Looking at your query, it is not query issue ,it is your data issue.
    Please check if you have data in  VPM2  table  which is bank transfer payment method
    Thank you
    Bishal
    Edited by: Bishal Adhikari on Apr 9, 2009 8:48 AM

Maybe you are looking for

  • Macbook Pro won't work with external display?

    The very first time I connected my brand new Macbook Pro to my 23" Cinema Display the laptop screen displayed mostly static, though the external monitor continued to work. The computer was sent to Apple for repair. Apple replaced the logic board. Tho

  • Can't connect Airport Express to my main wireless network, just my guest account.

    I go to join my Airport Express to my wireless network so I can play music from Itunes to my sound system in my living room.  That is all I want to use it for at this point.  I pull up a list of the networks available, and my guest network shows up o

  • How to select data from an internal table

    material                          norm                    date last modified B2-SP HEAT                 50.000               20090420 BF COKE                                 575.000               20090419 GROSS COKE                 200.000           

  • Creating a Staff without a midi part??

    Hi, I'm trying to score something in Logic. If look at scoring in the manual, it tells me "a staff must exist" before you can score (well obviously!). Is it possible for me to create a score before a midi part exists. So can I create a new project, g

  • Draw arc in a boolean array

    Hello everyone I want to extract the coordinate of an arc and use them to draw the same arc in a 2D boolean array, I have the start point coordinates, the end point coordinates, the center coordinates and the radius value. the result should be like t