Jump to content

ts145nera

Members
  • Posts

    2
  • Joined

  • Last visited

ts145nera's Achievements

Newbie

Newbie (1/14)

  • First Post Rare
  • Conversation Starter Rare
  • Week One Done
  • One Month Later
  • One Year In

Recent Badges

0

Reputation

  1. Hi, I've a problem with iReport. I have made a report with this query: SELECT to_char(date,'HH') as ora, element as campo FROM TABLE WHERE Field1 = $P{parm1} AND Field2 = $P{parm2} GROUP BY to_char(date,'HH') UNION SELECT hour as ora, 0 as campo from HOURS WHERE hour not in (SELECT to_char(date,'HH') as ora, element FROM TABLE WHERE Field1 = $P{parm1} AND Field2 = $P{parm2} GROUP BY to_char(date,'HH')) With query result I have made a chart, but when I run the report the chart is repeated 24 times, one for each hour. WHY???
  2. Hi, I'm a newbie. I've a problem with iReport. I would do: SELECT DISTINCT Diff_Date(to_date($P{DATA_INI},'DD/MM/YYYY'),to_date($P{DATA_FINE},'DD/MM/YYYY')) FROM TABLE WHERE (DEP = $P{VALORE}) UNION SELECT DISTINCT Diff_Date(to_date($P{DATA_INI},'DD/MM/YYYY'),to_date($P{DATA_FINE},'DD/MM/YYYY')) FROM TABLE But I've an Oracle Error ORA-01858: a non-numeric character war found where a numeric was expected. Diff_Date is a stored procedure and its prototype is: CREATE OR REPLACE FUNCTION Diff_Date (p_d1 in date, p_d2 in date ) return number Where is the problem? If I move WHERE clause in the second SELECT that is: SELECT DISTINCT Diff_Date(to_date($P{DATA_INI},'DD/MM/YYYY'),to_date($P{DATA_FINE},'DD/MM/YYYY')) FROM TABLE UNION SELECT DISTINCT Diff_Date(to_date($P{DATA_INI},'DD/MM/YYYY'),to_date($P{DATA_FINE},'DD/MM/YYYY')) FROM TABLE WHERE (DEP = $P{VALORE}) It work fine. But I must solve the problem in the first case that is a semplification of the real situation. Can you help me? Thank you so much
×
×
  • Create New...