SoapUi JDBC request - Problem in running query.
Hi,
I am trying to run a query in JDBC request but its not fetching me the result from oracle database. Query is :
select substr(transaction_date_key,1,6), sum(transaction_value), sum(total_discount) from f_customer_trans_new where
d_customer_key = (select d_customer_key from <table>where cust_number =:customerId)
and substr(transaction_date_key,1,6) >= substr(TRUNC(ADD_MONTHS(TRUNC(ADD_MONTHS(SYSDATE(), -3),'MM'),-12),'MM'),1,7)
and substr(transaction_date_key,1,6) <= substr(TRUNC(ADD_MONTHS(SYSDATE(),-3),'MM'),1,7)
GROUP BY substr(transaction_date_key,1,6)
but same qery runs correctly in SQL client
Below query gives me correct result.
select substr(transaction_date_key,1,6), sum(transaction_value), sum(total_discount) from f_customer_trans_new where
d_customer_key = (select d_customer_key from <table> where cust_number =:customerId)
GROUP BY substr(transaction_date_key,1,6)
I am not able to understand where is the problem , is it because of the functions - TRUNC, SYSDATE, ADD_MONTHS ?