SELECT * from Rpt_history_money where Customer_price_per_day =0 and Real_pay_money <0
SELECT * from Rpt_history_money_detail where Customer_price_per_day <0;
SELECT * from Rpt_history_money where date (serviced_days) > Date (beable_service_days);
SELECT count (DISTINCT service_day), order_id from Erp_work_day_opt_info where service_day like ' 2015-08% ' and rest_ Service_days =0 and Order_state =4 GROUP by order_id have COUNT (DISTINCT service_day) >1
SELECT * FROM Rpt_history_money a JOIN (select count (DISTINCT service_day) – 1 as AAA, order_id from Erp_work_day_opt_info where Service_day like ' 2015-08% ' and rest_service_days =0 and Order_state =4 GROUP by order_id have COUNT (DISTINCT serv Ice_day) >1
) b on a.order_id = b.order_id where a.month = ' 2015-08 ';
SELECT count (DISTINCT service_day), order_id from Erp_work_day_opt_info where service_day like ' 2015-08% ' and order_state =4 GROUP by order_id
SELECT * FROM Rpt_history_money a joins (SELECT count (DISTINCT service_day) as aaa,order_id from Erp_work_day_opt_info wher E service_day like ' 2015-08% ' and Order_state =4 GROUP by order_id
B on a.order_id = b.order_id where a.month = ' 2015-08 ' and aaa! = A.days_of_month;
Update Rpt_history_money a JOIN (SELECT count (DISTINCT service_day) as aaa,order_id from Erp_work_day_opt_info where servi Ce_day like ' 2015-08% ' and Order_state =4 GROUP by order_id
B on a.order_id = b.order_id set days_of_month = AAA where A.month = ' 2015-08 ' and aaa! = A.days_of_month;
Update Rpt_history_money a JOIN (SELECT count (DISTINCT service_day)-1 as AAA, order_id from Erp_work_day_opt_info where s Ervice_day like ' 2015-08% ' and rest_service_days =0 and Order_state =4 GROUP by order_id have COUNT (DISTINCT service_day ) >1
) b on a.order_id = b.order_id set days_of_month = AAA where A.month = ' 2015-08 ';
Update Rpt_history_money Set money_of_month = Customer_price_per_day * days_of_month;
SELECT count (DISTINCT service_day) -1,order_id,service_user_name,serivce_user_type from Erp_work_day_opt_info where Service_day like ' 2015-08% ' and rest_service_days =0 and Order_state =4 GROUP by order_id, Serivce_user_type, Service_use R_name
Having COUNT (DISTINCT service_day) >1;
Update Rpt_history_money_detail a JOIN (SELECT count (DISTINCT service_day)-1 as Aaa,order_id,service_user_name, Serivce_user_type from Erp_work_day_opt_info where service_day like ' 2015-08% ' and rest_service_days =0 and Order_state =4 GROUP by order_id, Serivce_user_type, Service_user_name
have COUNT (DISTINCT service_day) >1
) b on a.order_id = b.order_id and A.serivce_user_type =b.serivce_user_type and B.service_user_name =a.service_user_name set days_of_ month = days_of_month-aaa where a.month = ' 2015-08 ';
SELECT * FROM Rpt_history_money_detail a JOIN (select count (DISTINCT service_day)-1 as Aaa,order_id,service_user_name, Serivce_user_type from Erp_work_day_opt_info where service_day like ' 2015-08% ' and rest_service_days =0 and Order_state =4 GROUP by order_id, Serivce_user_type, Service_user_name
Having COUNT (DISTINCT service_day) >1
) b on a.order_id = b.order_id and A.serivce_user_type =b.serivce_user_type and B.service_user_name =a.service_user_name W Here A.month = ' 2015-08 ';
Update Rpt_history_money_detail Set money_of_month = Customer_price_per_day * days_of_month;
UPDATE Rpt_history_money Set Customer_price_per_day =round (Customer_price_per_day, 2), Money_of_month =ROUND (money_of _month, 2)
Change financial statement data