So far I don't think I'm doing to bad. The only thing that I cannot figure out is I do not want to see sales it is 0 in the dly_sys_mi_ttl.price_2_sls_ttl I just cannot figure it out. Any help would be appreciated. Doug
SELECT dly_sys_mi_ttl.business_date, dly_sys_mi_ttl.price_2_sls_cnt, dly_sys_mi_ttl.price_2_dsc_ttl, dly_sys_mi_ttl.price_2_sls_ttl, mi_def.name_1, fam_grp_def.name
FROM micros.dly_sys_mi_ttl dly_sys_mi_ttl, micros.fam_grp_def fam_grp_def, micros.mi_def mi_def
WHERE dly_sys_mi_ttl.mi_seq = mi_def.mi_seq AND mi_def.fam_grp_seq = fam_grp_def.fam_grp_seq
AND dly_sys_mi_ttl.business_date > current date - 14
AND (fam_grp_def.name = 'appetizers' OR fam_grp_def.name = 'well' OR fam_grp_def.name = 'Mixed drinks' OR fam_grp_def.name = 'Bottle beer'
OR fam_grp_def.name = 'Draft beer' OR fam_grp_def.name = 'Martini Well' OR fam_grp_def.name = 'Margarita')
ORDER BY dly_sys_mi_ttl.business_date, fam_grp_def.name
;output to "c:\hhsales1.xls" format lotus
SELECT dly_sys_mi_ttl.business_date, dly_sys_mi_ttl.price_2_sls_cnt, dly_sys_mi_ttl.price_2_dsc_ttl, dly_sys_mi_ttl.price_2_sls_ttl, mi_def.name_1, fam_grp_def.name
FROM micros.dly_sys_mi_ttl dly_sys_mi_ttl, micros.fam_grp_def fam_grp_def, micros.mi_def mi_def
WHERE dly_sys_mi_ttl.mi_seq = mi_def.mi_seq AND mi_def.fam_grp_seq = fam_grp_def.fam_grp_seq
AND dly_sys_mi_ttl.business_date > current date - 14
AND (fam_grp_def.name = 'appetizers' OR fam_grp_def.name = 'well' OR fam_grp_def.name = 'Mixed drinks' OR fam_grp_def.name = 'Bottle beer'
OR fam_grp_def.name = 'Draft beer' OR fam_grp_def.name = 'Martini Well' OR fam_grp_def.name = 'Margarita')
ORDER BY dly_sys_mi_ttl.business_date, fam_grp_def.name
;output to "c:\hhsales1.xls" format lotus