select firstName, lastName, email from tbl_FSpro_members m where m.fspro_userid = and m.ownerId = and m.fsl_tablecode = and m.orgId = select cdr.cdr_dstname as name, cdrd.accountNumber from tbl_CDR_Distributors cdr left outer join tbl_OPR_DistributionDetails cdrd on cdrd.cdr_recordId = cdr.cdr_recordId and cdrd.operatorId = where cdr.ownerId = and cdr.fsl_tablecode = and cdr.cdr_recordId = select cdr_dstName as partnerName, cdr_dstaddress1 as address, cdr_dstCity as city, cdr_dstState as state, cdr_dstzip as zip, cdr_dstphone as phone from tbl_CDR_Distributors where cdr_recordId = and ownerId = and fsl_tablecode = select companyName as partnerName, address, city, state, zipcode as zip, phone from tbl_OPR_ClientOperators where operatorId = and ownerId = and fsltablecode = #trim( qmd_partner.partnerName )##_crlf# #trim( qmd_partner.address )##_crlf# #qmd_partner.city#, #qmd_partner.state# #qmd_partner.zip# Phone: #qmd_partner.phone# Contact: #_contactFirst# #_contactLast# Distributor: #qmd_distributor.name# Distributor Customer Number: #qmd_distributor.accountnumber# #_crlf# #_callDetailText# Item: #qmd_product.description# SKU: #qmd_product.code# Status: #_dispositionDescription#, #lsnumberformat(_quantityAmt)# #qmd_unitOfMeasure.unitOfMeasurePlural#/#replacenocase(ucase(_durationUnit),"1T","one time sale")# #_crlf# BEGIN:VCALENDAR PRODID:-//Microsoft Corporation//Outlook 9.0 MIMEDIR//EN VERSION:1.0 BEGIN:VEVENT DTSTART:#dateformat(_intDate,"yyyymmdd")#T120000Z DTEND:#dateformat(_intDate,"yyyymmdd")#T130000Z UID:#createUUID()# DESCRIPTION;ENCODING=QUOTED-PRINTABLE:#_callDetailText# SUMMARY;ENCODING=QUOTED-PRINTABLE:#_callDetailPartnerName#: Sales Call PRIORITY:3 END:VEVENT END:VCALENDAR