ผู้เขียน หัวข้อ: Report Designer : ถ้ามีค่าอยู่ค่าหนึงแล้วต้องการเอาไปคูณและหารในVariableเดียว???  (อ่าน 5132 ครั้ง)

0 สมาชิก และ 1 บุคคลทั่วไป กำลังดูหัวข้อนี้

ออฟไลน์ golf_pk

  • Jr. Member
  • **
  • กระทู้: 72
  • ขอบคุณสังคมแห่งการแบ่งปัน สังคม hosxp
  • Respect: 0
    • ดูรายละเอียด
    • https://www.pkhos.moph.go.th
 ??? ??? ??? ??? มีค่ามีเก็บใน variable1.value แต่ผมอยากให้  ก่อนเอามาเก็บ ใน variable1.value ต้องผ่านการ  คูณและหารก่อนทำไงครับ  เช่น    variable1.value := ค่าได้จากคำสั่ง sql GetSQLIntegerData * 1000 / 38211  ทำอย่างไรครับ

  Value := GetSQLIntegerData('select ( select count(distinct(hn)) as hn from ovstdiag o   '+
' where o.vstdate BETWEEN "2010-10-01" AND "2011-09-30" and  icd10 BETWEEN "A050" and "A059" ) '+
'     + ( select count(distinct(ip.hn)) as hn from iptdiag i,ipt ip '+
' where i.an=ip.an and  ip.dchdate BETWEEN "2010-10-01" AND "2011-09-30" and  icd10 BETWEEN "A050" and "A059" ) '+
' as total')

end;


รบกวนอาจารย์อีกแล้วครับ
- วิรัตน์  ศรีวิโรจน์
- โรงพยาบาลปากคาด อ.ปากคาด จ.บึงกาฬ
- https://www.pkhos.moph.go.th
- ขนาด 30 เตียง 
- ขึ้นระบบ HOSxP เดือน เมษายน 2552
กำลังศึกษา ขอคำชี้แนะหน่อยนะครับ

กำลังศึกษาระบบฐานข้อมูล  ต้องการคำชีแนะจากอาจารย์ครับ  ขอรบกวนหน่อยนะครับ

ออฟไลน์ golf_pk

  • Jr. Member
  • **
  • กระทู้: 72
  • ขอบคุณสังคมแห่งการแบ่งปัน สังคม hosxp
  • Respect: 0
    • ดูรายละเอียด
    • https://www.pkhos.moph.go.th
 ??? ??? ??? ??? ???
ขอดันครับ
- วิรัตน์  ศรีวิโรจน์
- โรงพยาบาลปากคาด อ.ปากคาด จ.บึงกาฬ
- https://www.pkhos.moph.go.th
- ขนาด 30 เตียง 
- ขึ้นระบบ HOSxP เดือน เมษายน 2552
กำลังศึกษา ขอคำชี้แนะหน่อยนะครับ

กำลังศึกษาระบบฐานข้อมูล  ต้องการคำชีแนะจากอาจารย์ครับ  ขอรบกวนหน่อยนะครับ

ออฟไลน์ [-_เอ็ม_-]

  • Hero Member
  • *****
  • กระทู้: 1,472
  • [-- Developer มือใหม่ --]
  • Respect: +3
    • ดูรายละเอียด
    • โรงพยาบาลบรบือ
คงต้อง ประกาศตัวแปรประเภท Integer ก่อน

แล้วใน Calc ของ Variable1 ก็ประมาณนี้

var := GetSQLIntegerData
Value := (var * 1000) / 38211

ลองดูครับ :D
###### [- นิวัฒน์ <M> นัดสถาพร -] ######
   << นักวิชาการคอมพิวเตอร์ รพ.บรบือ >>
<< Rajabhat Mahasarakham University >>
------------------------------------------------------------------------------

ออฟไลน์ บิ๊กเบิร์ด

  • Full Member
  • ***
  • กระทู้: 203
  • ศรัทธา
  • Respect: +11
    • ดูรายละเอียด
    • http://lo.moph.go.th
??? ??? ??? ??? มีค่ามีเก็บใน variable1.value แต่ผมอยากให้  ก่อนเอามาเก็บ ใน variable1.value ต้องผ่านการ  คูณและหารก่อนทำไงครับ  เช่น    variable1.value := ค่าได้จากคำสั่ง sql GetSQLIntegerData * 1000 / 38211  ทำอย่างไรครับ

  Value := GetSQLIntegerData('select ( select count(distinct(hn)) as hn from ovstdiag o   '+
' where o.vstdate BETWEEN "2010-10-01" AND "2011-09-30" and  icd10 BETWEEN "A050" and "A059" ) '+
'     + ( select count(distinct(ip.hn)) as hn from iptdiag i,ipt ip '+
' where i.an=ip.an and  ip.dchdate BETWEEN "2010-10-01" AND "2011-09-30" and  icd10 BETWEEN "A050" and "A059" ) '+
' as total')

end;


รบกวนอาจารย์อีกแล้วครับ

ลอแบบนี้ครับ

variable1 :
Value := GetSQLIntegerData('select ( select count(distinct(hn)) as hn from ovstdiag o   '+
' where o.vstdate BETWEEN "2010-10-01" AND "2011-09-30" and  icd10 BETWEEN "A050" and "A059" );

variable2 :
GetSQLIntegerData('select count(distinct(ip.hn)) as hn from iptdiag i,ipt ip '+
' where i.an=ip.an and  ip.dchdate BETWEEN "2010-10-01" AND "2011-09-30" and  icd10 BETWEEN "A050" and "A059" ) '+
' as total');

variable3 :
Variable1.value * 1000

varable4 :
Variable3 / 38211

คิดได้ประมาณนี้ครัช
กัมปนาท  บุตรจันทร์  (bigbird)
นวก.คอมพิวเตอร์ @สสจ.เลย
mybigbird1983@gmail.com
blog : http://bigbird1983.blogspot.com/
---------------------------------------------------
วิธีใส่ลายเซ็น เพื่อแนะนำตัวเอง

ขอบคุณ ที่ก

ออฟไลน์ udomchok

  • Hero Member
  • *****
  • กระทู้: 8,347
  • Respect: +589
    • ดูรายละเอียด
    • ร.พ.สมเด็จพระสังฆราช องค์ที่ 17
ลอแบบนี้ครับ

variable1 :
Value := GetSQLIntegerData('select ( select count(distinct(hn)) as hn from ovstdiag o   '+
' where o.vstdate BETWEEN "2010-10-01" AND "2011-09-30" and  icd10 BETWEEN "A050" and "A059" );

variable2 :
GetSQLIntegerData('select count(distinct(ip.hn)) as hn from iptdiag i,ipt ip '+
' where i.an=ip.an and  ip.dchdate BETWEEN "2010-10-01" AND "2011-09-30" and  icd10 BETWEEN "A050" and "A059" ) '+
' as total');

variable3 :
Variable1.value * 1000

varable4 :
Variable3 / 38211

คิดได้ประมาณนี้ครัช

แล้ว variable2 ไว้ทำไร

แบบนี้หรือเปล่า
variable3=((variable1.value+variable2.value)*1000)/38211
ทำด้วยหัวใจร.พ.สมเด็จพระสังฆราช องค์ที่ 17 อ.สองพี่น้อง จ.สุพรรณบุรี
อบรมโดย BMS Team เมื่อ พ.ย. 49 ขึ้นระบบห้องบัตรเมื่อ X'Mas 2007
2008 : X-Ray กายภาพบำบัด แพทย์แผนไทย กิจกรรมบำบัด OPD ตา
2009 : ทันตกรรม ห้องตรวจตา OPD (พยาบาลและห้องตรวจแพทย์บางห้อง)

ออฟไลน์ บิ๊กเบิร์ด

  • Full Member
  • ***
  • กระทู้: 203
  • ศรัทธา
  • Respect: +11
    • ดูรายละเอียด
    • http://lo.moph.go.th
ลอแบบนี้ครับ

variable1 :
Value := GetSQLIntegerData('select ( select count(distinct(hn)) as hn from ovstdiag o   '+
' where o.vstdate BETWEEN "2010-10-01" AND "2011-09-30" and  icd10 BETWEEN "A050" and "A059" );

variable2 :
GetSQLIntegerData('select count(distinct(ip.hn)) as hn from iptdiag i,ipt ip '+
' where i.an=ip.an and  ip.dchdate BETWEEN "2010-10-01" AND "2011-09-30" and  icd10 BETWEEN "A050" and "A059" ) '+
' as total');

variable3 :
Variable1.value * 1000

varable4 :
Variable3 / 38211

คิดได้ประมาณนี้ครัช

แล้ว variable2 ไว้ทำไร

แบบนี้หรือเปล่า
variable3=((variable1.value+variable2.value)*1000)/38211


ใช่ครับพี่ชาย แหะๆ   ;D ;D
กัมปนาท  บุตรจันทร์  (bigbird)
นวก.คอมพิวเตอร์ @สสจ.เลย
mybigbird1983@gmail.com
blog : http://bigbird1983.blogspot.com/
---------------------------------------------------
วิธีใส่ลายเซ็น เพื่อแนะนำตัวเอง

ขอบคุณ ที่ก

ออฟไลน์ golf_pk

  • Jr. Member
  • **
  • กระทู้: 72
  • ขอบคุณสังคมแห่งการแบ่งปัน สังคม hosxp
  • Respect: 0
    • ดูรายละเอียด
    • https://www.pkhos.moph.go.th
ขอบคุณ อ.ทุกท่านครับ  หวังว่าจะได้รับความร่วมมือจาก อ.ทุกท่านอีกนะครับ
- วิรัตน์  ศรีวิโรจน์
- โรงพยาบาลปากคาด อ.ปากคาด จ.บึงกาฬ
- https://www.pkhos.moph.go.th
- ขนาด 30 เตียง 
- ขึ้นระบบ HOSxP เดือน เมษายน 2552
กำลังศึกษา ขอคำชี้แนะหน่อยนะครับ

กำลังศึกษาระบบฐานข้อมูล  ต้องการคำชีแนะจากอาจารย์ครับ  ขอรบกวนหน่อยนะครับ