SQLSTATE[HY000]: General error: 1525 Incorrect DATETIME value: ' 00:00:00'SELECT DISTINCT A.nYadoNo AS nYadoNo, A.nPlanNo AS nPlanNo, A.sPlanName AS sPlanName, A.sPlanText AS sPlanText, A.nPlanRateType AS nPlanRateType, A.bSaleTypeFlg AS bSaleTypeFlg, A.nLimitType AS nLimitType, A.nPlanSort FROM tPlan AS A LEFT JOIN (SELECT * FROM tPlanSale WHERE nYadoNo = :YadoNo AND nAgentNo = :AgentNo AND bPlanSleep = 0) AS B ON A.nYadoNo = B.nYadoNo AND A.nPlanNo = B.nPlanNo INNER JOIN (SELECT * FROM tPlanRateTbl WHERE nPlanRate > 0 AND nYadoNo = :YadoNo AND nAgentNo = :AgentNo) AS C ON B.nYadoNo = C.nYadoNo AND B.nPlanNo = C.nPlanNo AND B.nStockNo = C.nStockNo INNER JOIN tStock AS D on B.nYadoNo = D.nYadoNo AND B.nStockNo = D.nStockNo INNER JOIN (SELECT * FROM tStockTbl WHERE dStockDate >= :CheckIn AND dStockDate <= :CheckOut AND nYadoNo = :YadoNo AND (nStockInputNum - nStockResvNum) != 0) AS E ON D.nYadoNo = E.nYadoNo AND D.nStockNo = E.nStockNo WHERE A.nYadoNo = :YadoNo AND B.bPlanSleep = 0 AND B.nAgentNo = :AgentNo AND DATE_FORMAT(B.dPlanSaleSDate, '%Y/%m/%d') <= :Date AND DATE_FORMAT(B.dPlanEDate, '%Y/%m/%d') >= :StayDate AND DATE_FORMAT(C.dPlanDate, '%Y/%m/%d') = :StayDate AND DATE_FORMAT(E.dStockDate, '%Y/%m/%d') = :StayDate AND ((D.nStockType = 0 AND D.nStockManType = 0 AND ((E.nStockInputNum - E.nStockResvNum) >= 1 )) OR (D.nStockType = 0 AND D.nStockManType = 1 AND E.nStockInputNum >= 1) OR (D.nStockType = 1 AND D.nStockManType = 1)) ORDER BY A.nPlanSort array(6) { ["YadoNo"]=> string(1) "5" ["AgentNo"]=> int(5) ["Date"]=> string(10) "2024/12/02" ["CheckIn"]=> string(19) "2023-10-20 00:00:00" ["CheckOut"]=> string(9) " 00:00:00" ["StayDate"]=> string(10) "2023/10/20" }