8/24/2025 5:39:36 PM
|
|
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!
Forum to discuss writing script in Architect plugins for SalesLogix & general SalesLogix customization topics (for Windows client only). View the code of conduct for posting guidelines.
|
|
|
|
How to use top function while creating groups 
Posted: 09 Jul 08 8:45 AM
|
Hi
I need to create a group with the condition includes only top 5 records to be fetched from the table based on create date. I have tried in number of ways but i failed to find out how to use top function while creating groups. Any body having idea about this.
I also got another question like shall we create a group by passing the sql of the group through code.
Please help
Thanks in advance
Thanks, Mark
|
|
|
|
Re: How to use top function while creating groups 
Posted: 10 Jul 08 12:54 AM
|
Using the IN condition should work - it's the only way that you can actually enter some SQL in your group definition.
But ... I tried it and no records were displayed for me - even though the query executes perfectly in Management Studio.
Here is the group SQL I used, which should retrieve the 5 most recently created accounts:
SELECT A1.ACCOUNTID, A1.ACCOUNT, A2.CITY A2_CITY, A2.STATE A2_STATE, A1.MAINPHONE, A1.TYPE, A1.SUBTYPE, A1.STATUS, A1.ACCOUNTMANAGERID, A1.SECCODEID, A1.ACCOUNT_UC FROM ACCOUNT A1 INNER JOIN ADDRESS A2 ON (A1.ADDRESSID=A2.ADDRESSID) WHERE (A1.ACCOUNTID IN ((select top 5 ac.accountid from account ac order by ac.createdate desc))) ORDER BY A1.ACCOUNT_UC ASC
So close ... maybe you can work out why there is a problem in SLX.
Phil |
|
|
| |
| |
|
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!
|
|
|
|
|
|
|
|