BMS-HOSxP Community

HOSxP => Report Exchange => ข้อความที่เริ่มโดย: golf_pk ที่ กรกฎาคม 04, 2014, 21:47:15 PM

หัวข้อ: Report Designer : ถ้ามีค่าอยู่ค่าหนึงแล้วต้องการเอาไปคูณและหารในVariableเดียว???
เริ่มหัวข้อโดย: golf_pk ที่ กรกฎาคม 04, 2014, 21:47:15 PM
 ??? ??? ??? ??? มีค่ามีเก็บใน 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;


รบกวนอาจารย์อีกแล้วครับ
หัวข้อ: Re: Report Designer : ถ้ามีค่าอยู่ค่าหนึงแล้วต้องการเอาไปคูณและหารในVariableเดียว???
เริ่มหัวข้อโดย: golf_pk ที่ กรกฎาคม 04, 2014, 22:19:08 PM
 ??? ??? ??? ??? ???
ขอดันครับ
หัวข้อ: Re: Report Designer : ถ้ามีค่าอยู่ค่าหนึงแล้วต้องการเอาไปคูณและหารในVariableเดียว???
เริ่มหัวข้อโดย: [-_เอ็ม_-] ที่ กรกฎาคม 07, 2014, 12:01:52 PM
คงต้อง ประกาศตัวแปรประเภท Integer ก่อน

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

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

ลองดูครับ :D
หัวข้อ: Re: Report Designer : ถ้ามีค่าอยู่ค่าหนึงแล้วต้องการเอาไปคูณและหารในVariableเดียว???
เริ่มหัวข้อโดย: บิ๊กเบิร์ด ที่ กรกฎาคม 07, 2014, 12:20:58 PM
??? ??? ??? ??? มีค่ามีเก็บใน 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

คิดได้ประมาณนี้ครัช
หัวข้อ: Re: Report Designer : ถ้ามีค่าอยู่ค่าหนึงแล้วต้องการเอาไปคูณและหารในVariableเดียว???
เริ่มหัวข้อโดย: udomchok ที่ กรกฎาคม 07, 2014, 17:09:32 PM
ลอแบบนี้ครับ

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
หัวข้อ: Re: Report Designer : ถ้ามีค่าอยู่ค่าหนึงแล้วต้องการเอาไปคูณและหารในVariableเดียว???
เริ่มหัวข้อโดย: บิ๊กเบิร์ด ที่ กรกฎาคม 08, 2014, 10:58:27 AM
ลอแบบนี้ครับ

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
หัวข้อ: Re: Report Designer : ถ้ามีค่าอยู่ค่าหนึงแล้วต้องการเอาไปคูณและหารในVariableเดียว???
เริ่มหัวข้อโดย: golf_pk ที่ กรกฎาคม 08, 2014, 11:51:12 AM
ขอบคุณ อ.ทุกท่านครับ  หวังว่าจะได้รับความร่วมมือจาก อ.ทุกท่านอีกนะครับ