集團每月工單超領退料明細表●
sql_str += " select '"+para1+"' X1,tlf905 X2,to_char(tlf06,'yyyy/mm/dd') X3,tlf906 X4,tlf62 X5,tlf01 X6,ima02 X7,ima021 X8,(tlf10*tlf907*(-1)) X9, USERNAME X10 ";
sql_str += " from "+para1+".ima_file,"+para1+".tlf_file,"+para1+".sfp_file,ds.STAFF_file ";
sql_str += " where ima01 = tlf01 and tlf13 in ('asfi512','asfi527') and tlf907 <> 0 AND year(tlf06) LIKE '"+para2+"' AND month(tlf06) LIKE '"+para3+"' ";
sql_str += " and tlf905 = sfp01 and sfpuser = USERID(+) order by 2,3 ";
全站熱搜