OR a.dDate BETWEEN '".$_GET["summonth"]."' ตัวนี้นะครับ
Code (PHP)
$strSQL = "SELECT
MONTH(a.dDate) AS IMON,
YEAR(a.dDate) AS IYEAR,
SUM(b.iMoney) AS IMONEY,
SUM(b.iQuantity) AS IQTY
FROM [192.168.0.20].UFDATA_009_2012.dbo.SaleBillVouch AS a
RIGHT OUTER JOIN
[192.168.0.20].UFDATA_009_2012.dbo.SaleBillVouchs AS b
ON (a.SBVID = b.SBVID)
LEFT JOIN
[192.168.0.4].ims_data.dbo.month AS c
ON (MONTH(a.dDate) = c.m_id collate Thai_CI_AI)
WHERE (a.dDate BETWEEN '$startdatebill' AND '$enddatebill')
OR a.dDate BETWEEN '".$_GET["summonth"]."'
AND b.cInvCode = '$id'
GROUP BY MONTH (a.dDate), YEAR (a.dDate)
";