sql - Get data use between date -


i have query data cost_month / month :

select sum(xscf_cost_month) cost_month ncloud_data_service_cof join ncloud_data_ba b on b.xcba_cof_no = a.xscf_cof_no to_time('2014-05', 'yyyy-mm') between to_char(b.xcba_activation_date, 'yyyy-mm') , to_char(b.xcba_end_activation_date, 'yyyy-mm') 

query above display error : "error: operator not exist: date >= text line 4: to_date('2014-05', 'yyyy-mm') between to_char(b.xcba_a..."

how fix it? try change to_char to_time no solution. please me..

do intend this?

select sum(xscf_cost_month) cost_month ncloud_data_service_cof join      ncloud_data_ba b      on b.xcba_cof_no = a.xscf_cof_no '2014-05' between to_char(b.xcba_activation_date, 'yyyy-mm') ,                          to_char(b.xcba_end_activation_date, 'yyyy-mm'); 

you don't need convert string '2014-05'. string.


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -