here's the SQL needed to produce a custom report to show sales lead and sales prospect appointments due in the next 30 days.
just go to Reports->Custom Report Builder in Amphis Customer, create a new report and add this SQL. (you don't have to understand any of it, just copy and paste it)
select c.displayid as CustomerId, c.CompanyName, c.LastName as [Last Name],c.FirstName as [First Name],
apptstarttime as [Start Time], apptsubject as [Subject], apptdesc as [Description], apptlocation as [Location],
s.lookupvalue as customerstatus
from customer c ,appointment a, lookup_customerstatus s
where c.customerid=a.customerid
AND a.apptstarttime < DATE()+30 AND a.apptstarttime > DATE()-1
and customerstatusid in (select lookupkey from lookup_customerstatus where lookupvalue in ('sales lead','sales prospect'))
and c.customerstatusid = s.lookupkey
ORDER BY 5
save the report and now you can run the report any time from the My Reports menu.
Subscribe to:
Post Comments (Atom)

0 comments:
Post a Comment