REPORTFORM;SER1.frf
TITLE;ตารางการนัดหมายลูกค้าประจำวัน
SQL;select 
SQL;appid,timeapp,serapp.accid,armst.XCOMP,xphone,
SQL;carmst.CARID, xclass.CDESC, serapp.KM, service.SERDESC,
SQL;serapp.CONEMAIL,
SQL;if(left(pktype,2)="01",1,0) as QS,
SQL;if(left(pktype,2)="02",1,0) as telw,
SQL;if(left(pktype,2)="03",1,0) as CUS,
SQL;if(left(pktype,2)="04",1,0) as DCRC
SQL;from serapp inner join armst on serapp.ACCID = armst.ACCID
SQL;inner join carmst on serapp.VIN = carmst.VIN
SQL;inner join xclass on carmst.CID = xclass.CID
SQL;left join service on serapp.SERID = service.SERID
CONDITION;ตั้งแต่วันที่นัดหมาย~DATEAPP~Date~2~~
EXCELSQL;select 
EXCELSQL;appid,timeapp,serapp.accid,armst.XCOMP,xphone,
EXCELSQL;carmst.CARID, xclass.CDESC, serapp.KM, service.SERDESC,
EXCELSQL;serapp.CONEMAIL,
EXCELSQL;if(left(pktype,2)="01",1,0) as QS,
EXCELSQL;if(left(pktype,2)="02",1,0) as telw,
EXCELSQL;if(left(pktype,2)="03",1,0) as CUS,
EXCELSQL;if(left(pktype,2)="04",1,0) as DCRC
EXCELSQL;from serapp inner join armst on serapp.ACCID = armst.ACCID
EXCELSQL;inner join carmst on serapp.VIN = carmst.VIN
EXCELSQL;inner join xclass on carmst.CID = xclass.CID
EXCELSQL;left join service on serapp.SERID = service.SERID
