Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Friday, August 29, 2025 
 
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!
 Architect Forums - SalesLogix Scripting & Customization
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.
Forums RSS Feed


 Back to Forum List | Back to SalesLogix Scripting & Customization | New ThreadView:  Search:  
 Author  Thread: Subquery is not supported SLX LAN v7.2.1
SLX_Novice
Posts: 246
 
Subquery is not supported SLX LAN v7.2.1Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 07 Jul 09 12:11 PM
Hi all. I tried using the following script but I get an error in SLX Lan V7.2.1: Subquery is not supported

sql_AvgDays = "SELECT AVG(Days) AS AvgDays FROM (SELECT SALES_STAGE, CASE WHEN END_DATE IS NULL THEN Datediff(D, CreateDate, GetDate()) ELSE DateDiff(D, CreateDate, End_Date) END AS Days"
sql_AvgDays = sql_AvgDays & " FROM sysdba.C_myTable) T1"
sql_AvgDays = sql_AvgDays & " WHERE (SALES_STAGE = 'Lost')"

How can I get this to work if it doesn't allow subqueries?
[Reply][Quote]
Phil Parkin
Posts: 819
Top 10 forum poster: 819 posts
 
Re: Subquery is not supported SLX LAN v7.2.1Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 07 Jul 09 9:55 PM
I don't think you need a subquery for that. Here's some modified SQL that, I think, gives you what you need:

SELECT t1.SALES_STAGE, avg(Datediff(D, t1.CreateDate, Coalesce(t1.End_Date, GetDate()))) Days
from C_myTable t1
where t1.sales_Stage = 'Lost'
group by t1.Sales_Stage


I cannot remember whether the SLX OLEDB Provider supports COALESCE though. Note also that you should not use the sysdba prefix - you are accessing the database as the sysdba user and therefore that will be your default schema.

[Reply][Quote]
SLX_Novice
Posts: 246
 
Re: Subquery is not supported SLX LAN v7.2.1Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 08 Jul 09 2:36 PM
Thanks Phil, that worked great! And YES it does support Coalesce.
[Reply][Quote]
Phil Parkin
Posts: 819
Top 10 forum poster: 819 posts
 
Re: Subquery is not supported SLX LAN v7.2.1Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 08 Jul 09 6:57 PM
No problem - thanks for posting back.
[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 © 2025 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): 8/29/2025 12:00:48 PM