Merhaba, between ile denemiştim önce aynı sonucu veriyor,
<?php
$AyBaslangic = date('d.m.Y',strtotime('first day of this month')).' 00:00:00';
$AyBitis = date('d.m.Y',strtotime('last day of this month')).' 23:59:59';
$AyTL="TL";
$AySorgu = $db->prepare("select sum(Toplam) from siparisdetay where Tarih BETWEEN :AyBaslangic and :AyBitis and ParaBirim=:ParaBirim ");
$AySorgu->bindParam(':AyBaslangic',$AyBaslangic, PDO::PARAM_STR);
$AySorgu->bindParam(':AyBitis',$AyBitis, PDO::PARAM_STR);
$AySorgu->bindParam(':ParaBirim',$AyTL, PDO::PARAM_STR);
$AySorgu->execute();
$TutarAySorgu = $AySorgu->fetch(PDO::FETCH_NUM);
?>
TL Satış = <?php echo number_format($TutarAySorgu[0], 2, ',', '.'); ?>
$AySorgu = $db->prepare("select sum(Toplam) from siparisdetay where Tarih >=:AyBaslangic and Tarih <=:AyBitis and ParaBirim=:ParaBirim ");burada AND yerine BETWEEN kullanmalısınız