Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Monday, November 25, 2024 
 
slxdeveloper.com Community Forums  
   
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
 Reporting & Notification Forums - Reporting
Forum to discuss reports for SalesLogix including Crystal, SQL Reports, etc. View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to Reporting | New ThreadView:  Search:  
 Author  Thread: Last meeting query?
Paula Shuler
Posts: 22
 
Last meeting query?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 31 Aug 17 6:15 PM

I am trying to build a query in Slx to show me all of the accounts that had a meeting, and when that last meeting was. So far the closest I have gotten it to work is using this under Historyid with the 'in' operator:


SELECT A3.HISTORYID FROM HISTORY A3 WHERE A3.TYPE = 262145 AND A3.COMPLETEDDATE = (SELECT MAX(A4.COMPLETEDDATE) FROM HISTORY A4 WHERE A4.ACCOUNTID = A3.ACCOUNTID) 


For some reason however, hundreds of accounts are excluded and I cannot figure out why. I've even tried using STARTDATE and CREATEDATE and it doesn't seem to change exluding some accounts.


Any ideas what I could do? 

 

[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: Last meeting query?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 01 Sep 17 11:50 AM

You'll need to group the results for it to be accurate. A sub-query won't cut it. Try something like this:


select 
AccountID
, max(completeddate) as LastMeetingDate
from
sysdba.history
where
type = 262145
group by
accountid
[Reply][Quote]
 Page 1 of 1 
  You can subscribe to receive a daily forum digest in your user profile. View the site code of conduct for posting guidelines.

   Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
 

 
 slxdeveloper.com is brought to you courtesy of Ryan Farley & Customer FX Corporation.
 This site, and all contents herein, are Copyright © 2024 Customer FX Corporation. The information and opinions expressed here are not endorsed by Sage Software.

code of conduct | Subscribe to the slxdeveloper.com Latest Article RSS feed
   
 
page cache (param): 11/25/2024 12:55:22 AM