某月開始時間結束時間

 
 
 
這個能用
 
 
select dn.postDate
   from TBL_CRM_DELIVERYNOTE dn
 where dn.postDate >=
        trunc(to_date('2015-03', 'YYYY-MM'), 'mm')
    and dn.postDate <
        add_months(trunc(to_date('2015-03', 'YYYY-MM'), 'mm'),1)
 and dn.bStatus = 209201 order by dnlId desc
 
 
 
 
 
 
select dn.shiptoNo as shiptoNo,dn.shiptoName as shiptoName,  SUM(dn.dCount) AS dCount from TBL_CRM_DELIVERYNOTE dn where   
dn.createDate between trunc(to_date('2015-01-01 00:00:00','YYYY-MM'),'mm')
 and add_months(trunc(to_date('','YYYY-MM'),'mm'),1) and dn.bStatus = 209201
 and dn.tzFlag = 209101 GROUP BY dn.shiptoNo,dn.shiptoName order by shiptoNo
 
 
 
select dn.shiptoNo as shiptoNo,dn.shiptoName as shiptoName,  SUM(dn.dCount) AS dCount
 from TBL_CRM_DELIVERYNOTE dn where   dn.createDate between trunc(to_date('2015-01','YYYY-MM'),'mm')
and add_months(trunc(to_date('2015-01','YYYY-MM'),'mm'),1)
 and dn.bStatus = 209201  and dn.tzFlag = 209101 GROUP BY dn.shiptoNo,dn.shiptoName order by shiptoNo
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章