BMS-HOSxP Community

HOSxP => แจ้งปัญหา / ขอความช่วยเหลือ => ข้อความที่เริ่มโดย: natch2005 ที่ ธันวาคม 28, 2012, 15:15:03 PM

หัวข้อ: ต้องการเขียน Report ที่มีตัวแปร 3 ตัวแปรเหมือนในรูปครับ ต้องทำอย่างไรครับ
เริ่มหัวข้อโดย: natch2005 ที่ ธันวาคม 28, 2012, 15:15:03 PM
ต้องการเขียน Report ที่มีตัวแปร 3 ตัวแปรเหมือนในรูปครับ ต้องทำอย่างไรครับ
ขอบคุณล่วงหน้าครับ
หัวข้อ: Re: ต้องการเขียน Report ที่มีตัวแปร 3 ตัวแปรเหมือนในรูปครับ ต้องทำอย่างไรครับ
เริ่มหัวข้อโดย: pop_hosxp ที่ ธันวาคม 28, 2012, 16:26:05 PM
ต้องเขียนใน Event OnCreate ลองดูนะครับ

โค๊ด: Delphi
  1. var
  2. date1, date2:tdatetime;
  3. ds1, ds2, doctor:string;
  4.  
  5. GetDateRangeDialog(Date1, Date2);
  6. ds1:=formatdatetime(date1,"yyyy-mm-dd");
  7. ds2:=formatdatetime(date2,"yyyy-mm-dd");
  8.  
  9. doctor:=GetPickupList('select name from doctor order by name');
  10. doctor:=GetSQLStringData('select code from doctor where name="'+doctor+'" ');
  11.  
  12. ChangeReportSQL('select aaa from bbb where vstdate between "'+ds1+'" and "'+ds2+'" and doctor="'+doctor+'" ');