I've been trying like crazy to recreate what's printed on a guest check with a SQL query and I'm not finding the correct tables.
My test SQL statement is listed here with a bunch of test columns but this isn't the final check, it looks like what is sent to the kitchen.
ANY help would be greatly appreciated!!
Thanks,
George
My test SQL statement is listed here with a bunch of test columns but this isn't the final check, it looks like what is sent to the kitchen.
ANY help would be greatly appreciated!!
Code:
select
tdtl.chk_emp_seq as Check_Emp,
tdtl.chk_seq as Check_Seq,
tdtl.cshr_ttl_seq as Cashier_Total_Seq,
tdtl.end_date_tm as End_date,
tdtl.trans_emp_seq as Transaction,
tdtl.trans_seq as Transaction_Seq,
d.chk_cnt as Check_Count,
d.chk_ttl as Check_Total,
d.date_time as Date_Time,
d.dtl_index as Detail_Index,
d.dtl_seq as Detail_Seq,
d.dtl_type as Detail_Type,
d.record_type as Record_type,
d.rpt_cnt as Report_Count,
d.rpt_ttl as Report_Total,
d.seat as Seat,
mdef.name_1 as MenuName1,
mdef.name_2 as MenuName2,
ckdtl.amt_due_ttl as TotalBill,
ckdtl.auto_svc_ttl as SvcChargeTtl,
ckdtl.chk_num as CheckNum,
ckdtl.chk_seq as CheckSeq,
ckdtl.cov_cnt as CoverCnt,
ckdtl.emp_seq as EmployeeSeq,
ckdtl.num_dtl as DetailNum,
ckdtl.order_type_seq as OrderType,
ckdtl.pg_num as PageNum,
ckdtl.pymnt_ttl as PaymentTot,
ckdtl.sub_ttl as SubTotal,
ckdtl.tax_ttl as TaxTotal,
ckdtl.tbl_open_date_time as TableOpnDate
from micros.trans_dtl as tdtl join
micros.dtl as d on
tdtl.trans_seq = d.trans_seq join
micros.mi_dtl as mdtl on
d.trans_seq = mdtl.trans_seq and
d.dtl_seq = mdtl.dtl_seq join
micros.mi_def as mdef on
mdtl.mi_seq = mdef.mi_seq join
micros.chk_dtl as ckdtl on
tdtl.chk_seq = ckdtl.chk_seq
where ckdtl.chk_num = 348;
output to 'D:\micros\database\data\chkdt348.txt'
Thanks,
George