คำสั่งใน Varaible น่ารู้ การแก้ ค.ศ. เป็น พ.ศ.

คำสั่งใน Varaible น่ารู้ เช่น การดึงชื่อแพทย์ 
การแสดงผลวันที่ภาษาไทย hosxp windows 7 8 10 11 ค.ศ. =  พ.ศ.


Varaible น่ารู้

การใช้ dbmemo ส่วนฝั่งขวามือเป็นการ dbrichtext ผลที่ได้จากการ preview คือ ค่าบางค่าของ record ที่ได้จากการ dbmemo อ่านค่าออกมาเป็นภาษาที่เราไม่รู้จัก แต่ไม่มีปัญหากับการใช้ dbrichtext

RichText1.RichText :=GetSQLStringData('select concat(help3_icode," @",help3_time," qty=",help3_qty) from opdscreen where vn=" '+DBPipeline['vn']+' " ');


Value := GetSQLStringData('select name from er_emergency_type emer left join er_regist er on emer.er_emergency_type=er.er_emergency_type left join vn_stat vns on er.vn=vns.vn where er.vn="'+DBPipeline['vn']+'" ');


Value :=GetSQLIntegerData('select count(*)'+
' from er_regist left join er_nursing_detail ern on er_regist.vn=ern.vn'+
' where er_regist.vstdate between "'+ds1+'" and "'+ds2+'"'+
' and er_regist.er_pt_type="2" and er_regist.er_emergency_type="1" ');

ดึงชื่อโรงพยาบาล
Value := GetSQLStringData('select concat(hosptype,name)as hname from hospcode where hospcode="'+ DBPipeline['hospmain'] +'"');
Value := GetSQLStringData('select concat(hosptype,name)as hname from hospcode where hospcode=('+ getsqlsubquerydata('select hospmain from vn_stat where vn = " '+DBPipeline['vn']+' " ')+') ');
Value := GetSQLStringData('select concat( o.hospitalname,' ??????? ', t.full_name) as hosp_address from opdconfig o join hospcode h on h.hospcode = o.hospitalcode join thaiaddress t on t.addressid = concat(h.chwpart,h.amppart,h.tmbpart)');


ดึงชื่อแพทย์

Value := GetSQLStringData('select name as dname from doctor where code="'+ DBPipeline['admdoctor']+'"');

การบวก Variable ต้องกำหนดข้อมูลให้เป็น interger คำสั่ง Value:=Variable1.value+Varaible2.value;


การดึงวันที่เลือกข้อมูลมาใส่ในรายงาน
แบบที่ 1 (สร้าง Lebel ไปที่ calc >events> select lebel> ongetTexe  > copy>past

Text := 'ข้อมูลช่วงวันที่ '+ISO2Date(GetUserParameter(0),'dd mmmm eee')+ ' ถึง '+
ISO2Date(GetUserParameter(1),'dd mmmm eee') ;

Text := FormatThaiDate('d mmmm yyyy',DBPipeline['vstdate']);

Text := '¾ÔÁ¾ì ³ Çѹ·Õè '+FormatThaiDate('d mmmm yyyy', CurrentDate)+' àÇÅÒ '+TimeToStr(CurrentTime)+' ¹.';


แบบที่2 สร้าง Variable Value := formatdatetime('dd/mm/eeee',td1); และ
Value := formatdatetime('dd/mm/eeee',td2);

การบวกวันที่
Value := getsqldatedata('select timestampadd(day,1,start_date) '+
' from ipd_profile_print where an="'+DBPipeline['an'] +'"');

หมายเหตุ ใน วันที่ win7 จะใช้ dd mm eee ไม่ได้
ต้องใช้ function กำกับใน report คือ formatthaidate('d mmmm yyyy',date1);

ตัวอย่าง  Variable
Value := FormatThaiDate('d mmmm yyyy',DBPipeline['birthday'])
Value := FormatThaiDate('d mmmm yyyy', DBPipeline['vstdate'])
Value := FormatThaiDate('d mmmm yyyy',DBPipeline['expiredate'])
Value := FormatThaiDate('d mmmm yyyy', DBPipeline['regdate'])
Value := FormatThaiDate('d mmmm yyyy',DBPipeline['DOB'])
Value := FormatThaiDate('d mmmm yyyy',CurrentDate)


แสดงความคิดเห็น (0)
ใหม่กว่า เก่ากว่า