Vote count:
0
The following MS SQL query works fine in MS SQL Management Studio but not with PHP. I didn't get any error, but the mssql_num_rows return 0.
Query:
SELECT
S.LS,
S.IstWADatum,
S.Gesamtmenge,
SUM(T.Gesamtmenge) as GesamtmengeT,
SUM(PP.Gesamtmenge) as GesamtmengePP
FROM
dbo.SAPREPORT AS S
LEFT JOIN dbo.TRACE AS T
ON S.LS = T.LSNR
LEFT JOIN dbo.PKSPLUS AS PP
ON S.LS = PP.LSNR
WHERE
(S.Warenempfaenger = '1'
OR S.Warenempfaenger = '2'
OR S.Warenempfaenger = '3'
OR S.Warenempfaenger = '4'
OR S.Warenempfaenger = '5' )
AND S.IstWADatum = '12.03.2015'
GROUP BY
S.LS,
S.IstWADatum,
S.Gesamtmenge
The resultset in Studio is
LS IstWADatum Gesamtmenge GesamtmengeT GesamtmengePP xxx 2015-03-12 14 NULL NULL xxx 2015-03-12 1 NULL NULL xxx 2015-03-12 4 NULL NULL xxx 2015-03-12 4 NULL NULL xxx 2015-03-12 5 NULL NULL xxx 2015-03-12 23 NULL NULL xxx 2015-03-12 43 NULL NULL
Thanks
asked 6 mins ago
MS SQL query didn't work with PHP
Aucun commentaire:
Enregistrer un commentaire