Warning: include(../connect_mysql.php) [function.include]: failed to open stream: No such file or directory in E:\www\mobile\no\_ps\ps_sa_by_mt.php on line 13
Warning: include() [function.include]: Failed opening '../connect_mysql.php' for inclusion (include_path='.;C:\php5\pear') in E:\www\mobile\no\_ps\ps_sa_by_mt.php on line 13
Warning: include(../connect.php) [function.include]: failed to open stream: No such file or directory in E:\www\mobile\no\_ps\ps_sa_by_mt.php on line 14
Warning: include() [function.include]: Failed opening '../connect.php' for inclusion (include_path='.;C:\php5\pear') in E:\www\mobile\no\_ps\ps_sa_by_mt.php on line 14
Warning: include(../function.php) [function.include]: failed to open stream: No such file or directory in E:\www\mobile\no\_ps\ps_sa_by_mt.php on line 15
Warning: include() [function.include]: Failed opening '../function.php' for inclusion (include_path='.;C:\php5\pear') in E:\www\mobile\no\_ps\ps_sa_by_mt.php on line 15
SELECT cu.OKALCU as STORE,
Sum(case when substring(cast(oh.OAORDT as VARCHAR(8)),5,2) IN('01') then CONVERT(DECIMAL(10,2),()) else 0 end) [M1],
Sum(case when substring(cast(oh.OAORDT as VARCHAR(8)),5,2) IN('02') then CONVERT(DECIMAL(10,2),()) else 0 end) [M2],
Sum(case when substring(cast(oh.OAORDT as VARCHAR(8)),5,2) IN('03') then CONVERT(DECIMAL(10,2),()) else 0 end) [M3],
Sum(case when substring(cast(oh.OAORDT as VARCHAR(8)),5,2) IN('04') then CONVERT(DECIMAL(10,2),()) else 0 end) [M4],
Sum(case when substring(cast(oh.OAORDT as VARCHAR(8)),5,2) IN('05') then CONVERT(DECIMAL(10,2),()) else 0 end) [M5],
Sum(case when substring(cast(oh.OAORDT as VARCHAR(8)),5,2) IN('06') then CONVERT(DECIMAL(10,2),()) else 0 end) [M6],
Sum(case when substring(cast(oh.OAORDT as VARCHAR(8)),5,2) IN('07') then CONVERT(DECIMAL(10,2),()) else 0 end) [M7],
Sum(case when substring(cast(oh.OAORDT as VARCHAR(8)),5,2) IN('08') then CONVERT(DECIMAL(10,2),()) else 0 end) [M8],
Sum(case when substring(cast(oh.OAORDT as VARCHAR(8)),5,2) IN('09') then CONVERT(DECIMAL(10,2),()) else 0 end) [M9],
Sum(case when substring(cast(oh.OAORDT as VARCHAR(8)),5,2) IN('10') then CONVERT(DECIMAL(10,2),()) else 0 end) [M10],
Sum(case when substring(cast(oh.OAORDT as VARCHAR(8)),5,2) IN('11') then CONVERT(DECIMAL(10,2),()) else 0 end) [M11],
Sum(case when substring(cast(oh.OAORDT as VARCHAR(8)),5,2) IN('12') then CONVERT(DECIMAL(10,2),()) else 0 end) [M12],
Sum(case when substring(cast(oh.OAORDT as VARCHAR(8)),1,4) IN('') then CONVERT(DECIMAL(10,2),()) else 0 end) [TOTAL]
FROM MVXJDTA.OOHEAD AS oh
INNER JOIN MVXJDTA.CMNUSR AS cm ON oh.OASMCD = cm.JUUSID
INNER JOIN MVXJDTA.OCUSMA AS cu ON oh.OACUNO = cu.OKCUNO
WHERE (oh.OAORDT like '%') AND (((oh.OAORST BETWEEN '22' AND '77') OR (oh.OAORST IN ('99'))) AND (oh.OAORSL NOT IN ('99')))
AND (oh.OAORTP IN ('011','911','A11')) AND (oh.OASMCD not in('11000','30001','30002','30003','30004'))
AND (oh.OACUNO IN('10500023','70120007','S1500001','S1500002','27120038','43000029','S8000001','S6000006','S6000007','S7000001','S7000002','S7000004','S7000005','S7000007','S7000009','S7000011','S7000013','S7000015','S5000001','S5000002','S3000001','S3000002','S3000003','S3000004','S3000005','S3000006','S3000009','S3000010','S2000030','S2000050','S2000051','S2000052','S2000053','S9000001','S9000002','S9000003'))
group by cu.OKALCU
order by cu.OKALCUยอดขาย by ห้าง
ห้าง |
JAN |
FEB |
MAR |
APR |
MAY |
JUN |
JUL |
AUG |
SEP |
OCT |
NOV |
DEC |
TOTAL |
Warning: odbc_fetch_row(): supplied argument is not a valid ODBC result resource in E:\www\mobile\no\_ps\ps_sa_by_mt.php on line 75
|