BMS-HOSxP Community
HOSxP => แจ้งปัญหา / ขอความช่วยเหลือ => ข้อความที่เริ่มโดย: panus_t ที่ กรกฎาคม 16, 2012, 10:46:15 AM
-
ต้องการ SUM rcpt_money ตามวันที่ ตามสิทธิ ครับ
ต้องการทราบว่าต้องเขียน code mysql แบบไหนครับ
-
;D ;D ;D ??? ???
เอาแค่สิทธิ 2 สิทธินี้เหรอครับ...ข้าราชการ กับ ประกันสังคม..
รายละเอียดที่ต้องการ น่ะครับ.. :D :D
-
มันเยอะครับ ก็เลย post แค่ 2 สิทธิเผื่อเอาไปประยุกต์ ;D
จริง ๆ ก็มี สิทธิ ข้าราชการ ประกัน พรบ. กองทุนทดแทน ต่างด้าว ชำระเอง สิทธิอื่น ๆ ค้างชำระ และแยก 16 หมวดอีก ทั้งหมดอยู่ในรายงานเดียว....
-
ลองประยุกต์ด้วยการใช้ variable วางลงไปแล้วใช้คำสั่ง
value:=getsqlintegerdata('select sum(rcpt_money) '+
' from vn_stat '+
' where vstdate="'+dbpipeline['vstdate']+'" '+
' group by vstdate')
-
หน้าตารายงานครับ ;D
ไม่ทราบว่าจะเขียนคำสั่ง Select ครั้งเดียวจะได้หรือเปล่า ;D
-
;D ;D ;D น่าจะได้ครับ เอาไปประยุกต์เอาครับ..
คำสั่งน่าจะประมาณนี้ครับ.. แล้วไป sum รายการต่างๆ ตามที่ต้องการครับ... :D :D
select vstdate,sum(rcpt_money),pttype,
(if(pttype = "10",rcpt_money,0)) as `Cash`,
(if(pttype = "89",rcpt_money,0)) as `UC`,
(if(pttype in("34","35""36"),rcpt_money,0)) as `SSN`,
(if(pttype = "23",rcpt_money,0)) as `ACC_23` ,
(if(pttype = "30",rcpt_money,0)) as `Acident`,
(if(pttype = "20",rcpt_money,0)) as `ACC_20`,
(if(pttype = "22",rcpt_money,0)) as `ACC_22` ,
(if(pttype = "37",rcpt_money,0)) as `ACC_37` ,
(if(pttype = "88",rcpt_money,0)) as `ACC_88` ,
from vn_stat
where vstdate="2012-07-12"
group by vstdate,pttype order by vstdate,pttype
ลองไปประยุกต์ดูครับ... ถ้าไม่ใช่ที่ต้องการ รอ อ.ท่านอื่นๆครับผม.. ;D ;D ;D ;D
-
;D ;D ;D น่าจะได้ครับ เอาไปประยุกต์เอาครับ..
คำสั่งน่าจะประมาณนี้ครับ.. แล้วไป sum รายการต่างๆ ตามที่ต้องการครับ... :D :D
select vstdate,sum(rcpt_money),pttype,
(if(pttype = "10",rcpt_money,0)) as `Cash`,
(if(pttype = "89",rcpt_money,0)) as `UC`,
(if(pttype in("34","35""36"),rcpt_money,0)) as `SSN`,
(if(pttype = "23",rcpt_money,0)) as `ACC_23` ,
(if(pttype = "30",rcpt_money,0)) as `Acident`,
(if(pttype = "20",rcpt_money,0)) as `ACC_20`,
(if(pttype = "22",rcpt_money,0)) as `ACC_22` ,
(if(pttype = "37",rcpt_money,0)) as `ACC_37` ,
(if(pttype = "88",rcpt_money,0)) as `ACC_88` ,
from vn_stat
where vstdate="2012-07-12"
group by vstdate,pttype order by vstdate,pttype
ลองไปประยุกต์ดูครับ... ถ้าไม่ใช่ที่ต้องการ รอ อ.ท่านอื่นๆครับผม.. ;D ;D ;D ;D
จบยังไงครับ
select vstdate,sum(rcpt_money),pttype,
(if(pttype = "10",rcpt_money,0)) as `Cash`,
(if(pttype = "89",rcpt_money,0)) as `UC`,
(if(pttype in("34","35""36"),rcpt_money,0)) as `SSN`,
(if(pttype = "23",rcpt_money,0)) as `ACC_23` ,
(if(pttype = "30",rcpt_money,0)) as `Acident`,
(if(pttype = "20",rcpt_money,0)) as `ACC_20`,
(if(pttype = "22",rcpt_money,0)) as `ACC_22` ,
(if(pttype = "37",rcpt_money,0)) as `ACC_37` ,
(if(pttype = "88",rcpt_money,0)) as `ACC_88` ,
from vn_stat
where vstdate="2012-07-12"
group by vstdate,pttype order by vstdate,pttype
-
เอาไปใช้คำนวนต้นทุนหรือไม่
http://hosxp.net/index.php?option=com_view_smf_download&attachmentid=83630
-
;D ;D ;D น่าจะได้ครับ เอาไปประยุกต์เอาครับ..
คำสั่งน่าจะประมาณนี้ครับ.. แล้วไป sum รายการต่างๆ ตามที่ต้องการครับ... :D :D
select vstdate,sum(rcpt_money),pttype,
(if(pttype = "10",rcpt_money,0)) as `Cash`,
(if(pttype = "89",rcpt_money,0)) as `UC`,
(if(pttype in("34","35""36"),rcpt_money,0)) as `SSN`,
(if(pttype = "23",rcpt_money,0)) as `ACC_23` ,
(if(pttype = "30",rcpt_money,0)) as `Acident`,
(if(pttype = "20",rcpt_money,0)) as `ACC_20`,
(if(pttype = "22",rcpt_money,0)) as `ACC_22` ,
(if(pttype = "37",rcpt_money,0)) as `ACC_37` ,
(if(pttype = "88",rcpt_money,0)) as `ACC_88` ,
from vn_stat
where vstdate="2012-07-12"
group by vstdate,pttype order by vstdate,pttype
ลองไปประยุกต์ดูครับ... ถ้าไม่ใช่ที่ต้องการ รอ อ.ท่านอื่นๆครับผม.. ;D ;D ;D ;D
จบยังไงครับ
select vstdate,sum(rcpt_money),pttype,
(if(pttype = "10",rcpt_money,0)) as `Cash`,
(if(pttype = "89",rcpt_money,0)) as `UC`,
(if(pttype in("34","35""36"),rcpt_money,0)) as `SSN`,
(if(pttype = "23",rcpt_money,0)) as `ACC_23` ,
(if(pttype = "30",rcpt_money,0)) as `Acident`,
(if(pttype = "20",rcpt_money,0)) as `ACC_20`,
(if(pttype = "22",rcpt_money,0)) as `ACC_22` ,
(if(pttype = "37",rcpt_money,0)) as `ACC_37` ,
(if(pttype = "88",rcpt_money,0)) as `ACC_88` ,
from vn_stat
where vstdate="2012-07-12"
group by vstdate,pttype order by vstdate,pttype
;D ;D ;D ;D (if(pttype = "88",rcpt_money,0)) as `ACC_88` ,
ลบ , ออกเลยครับ ..ตัดมาให้ดูเฉยๆครับ
คือถ้าจะเพิ่ม เอาข้อมูลอะไรก็ใส่ คอมมา แล้วก็เลือกดึงครับ.. มันเป้นตัวอย่างครับ.. ;D ;D ;D ;D
เช่น รวม Income , paid_money, Uc_monney ฯลฯ ..
-
เอาไปใช้คำนวนต้นทุนหรือไม่
http://hosxp.net/index.php?option=com_view_smf_download&attachmentid=83630
ผิดหน้าหรือเปล่าครับ ^ ^!
-
เอาไปใช้คำนวนต้นทุนหรือไม่
http://hosxp.net/index.php?option=com_view_smf_download&attachmentid=83630
ไม่ได้เอาไปคำนวนต้นทุนครับ ถามการเงินบอกว่าเขาเก็บแบบนี้มานานแล้วตั้งแต่คนก่อน เก็บเอาไว้เฉย หรือเอาไว้ตรวจสอบ เงินสดที่ได้แต่ละวันโดยแยกตามแบบฟอร์มที่มีครับ