The IDs are ishijian1,ishijian2, and the statements are
Echo ';
?>
c_huizong.php
Order Enquiry
if ($_post[' 1shijian1 ')
{
echo "
document.getElementById (' 1shijian1 '). value= ' ". $_post[' 1shijian1 '].
"';d Ocument.getelementbyid (' 1shijian2 '). value= '". $_post[' 1shijian2 '].
"'; Cg1name ();";
if ($_post[' 1shijian1 ']<>null)
$shijian 1= "and COPTC. tc003>= ". $_post[' 1shijian1 ');
Else
$shijian 1 = "";
if ($_post[' 1shijian2 ']<>null)
$shijian 2= "and COPTC. tc003<= ". $_post[' 1shijian2 ');
Else
$shijian 2 = "";
Require_once (' i_code/connect.php ');
$query = "Select Leixing,xifen,sewen,ddgm,bztdb,daba,sum (TD008) as Td008,sum (TA015) ta015,sum (Rkzs) rkzs,sum (D310) D310,sum (D305) d305,sum (D304) d304,sum (D3023) d3023,sum (TH008) th008,sum (TJ007) TJ007
From Chaxun
Left joins DDTJMX on Ma003=leixing and Xifen=xifen and SEWEN=DDTJMX. UDF10 and DDGM=DDGM and Daba=xinghao
Left joins COPTC on TC001=DDTJMX. TD001 and TC002=DDTJMX. TD002
Where xifen<> ' and xifen<> ' 5050 ' and tc003>= ' 20150110 ' and tc003<= ' 20150120 '
GROUP by Leixing,xifen,sewen,ddgm,bztdb,daba
UNION ALL
Select Leixing,xifen,null as sewen,null as ddgm,bztdb,null as Daba,sum (TD008) as Td008,sum (TA015) ta015,sum (Rkzs) Rkzs, SUM (D310) d310,sum (D305) d305,sum (D304) d304,sum (D3023) d3023,sum (TH008) th008,sum (TJ007) TJ007
From Chaxun
Left JOIN ddtjmx on ma003=leixing and Xifen=xifen
Left joins COPTC on TC001=DDTJMX. TD001 and TC002=DDTJMX. TD002
where xifen= ' 5050 ' and tc003>= ' 20150110 ' and tc003<= ' 20150120 '
GROUP by Leixing,xifen,bztdb
UNION ALL
Select Leixing,null as xifen,null as sewen,null as DDGM,BZTDB, null as Daba,sum (TD008) as Td008,sum (TA015) ta015,sum (Rkzs) R Kzs,sum (D310) d310,sum (D305) d305,sum (D304) d304,sum (D3023) d3023,sum (TH008) th008,sum (TJ007) TJ007
From Chaxun
Left JOIN ddtjmx on ma003=leixing
Left joins COPTC on TC001=DDTJMX. TD001 and TC002=DDTJMX. TD002
Where xifen= ' and tc003>= ' 20150110 ' and tc003<= ' 20150120 '
GROUP by Leixing,bztdb ". $shijian 1. $shijian 2;
$result =mssql_query ($query);
$row _num=mssql_num_rows ($result);
if ($row _num<=10000 && $row _num>0)
{
echo "
while ($row =mssql_fetch_assoc ($result))
{
Echo
Echo
echo"
\n";
}
Echo
"; echo"
category | ;
subdivision | ;
Color temperature | ;
order size | ;
standard ratio of single investment | ;
Target Shooting | ;
order quantity | ;
expected yield | ;
total number of storage | ;
standard warehousing | ;
quantity of goods sold | ; The
number of pin back | ;
tracking Information | ;
";
";
". $row [' leixing ']." | "; Echo
". $row [' Xifen ']." | "; Echo
". $row [' Sewen ']." | "; Echo
". $row [' DDGM ']." | "; Echo
". $row [' Bztdb ']." | "; Echo
". $row [' Daba ']." | "; Echo
". Number_format ($row [' TD008 '],0)." | "; Echo
". Number_format ($row [' TA015 '],0)." | "; Echo
". Number_format ($row [' Rkzs '],0)." | "; Echo
". Number_format ($row [' D310 '],0)." | "; Echo
". Number_format ($row [' TH008 '],0)." | "; Echo
". Number_format ($row [' TJ007 '],0)." | "; Echo
Tracking information | "; Tracking information
";
Echo ';
}
Mssql_close ($conn);
}
?>
Now a running statement is wrong, is the following statement inside the query statement error, to correct.