<%
if request.form ("month_fueling") <> "" then
mon_split = Split(request.form ("month_fueling"),"/")
Set rstemp = Server.CreateObject("ADODB.Recordset")
'strSplit = Split("1,2,3",",")
sql = "SELECT *, ISNULL(qty,0) AS qty2, ISNULL(unit,0) As unit2 , ISNULL(kilo_no,0) AS kilo2 FROM wguses Where month(fill_date) = '"&mon_split(0)&"' and year(fill_date) = '"&mon_split(1)&"' AND card_no='"&request.form("fleet_id")&"' "
rstemp.open sql,sConn,1,3
if rstemp.EOF then
norecord="ไม่พบข้อมูลการใช้พลังงานเชื้อเพลิง"
else
norecord=""
countbill = rstemp.recordcount
consumption = Cdbl(0)
minn=Cdbl(rstemp("kilo2"))
While not rstemp.EOF
totalqty = Cdbl(totalqty) + Cdbl(rstemp("qty2"))
totalunit= Cdbl(totalunit) + Cdbl(rstemp("unit2"))
sumcost= Cdbl(sumcost) + (cdbl(rstemp("qty2"))* cdbl(rstemp("unit2")))
consumption = Cdbl(rstemp("kilo2"))
rstemp.movenext
Wend
Set rstemp =nothing
end if
end if
sql = "SELECT *, ISNULL(qty,0) AS qty2, ISNULL(unit,0) As unit2 , ISNULL(kilo_no,0) AS kilo2 FROM wguses Where month(fill_date) = '"&mon_split(0)&"' and year(fill_date) = '"&mon_split(1)&"' AND card_no='"&request.form("fleet_id")&"' "