CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> General/Other

 Error in SQL and other misc stuff

Print topic Send  topic

Author Message
Mango_Lier


Posts: 110
Posted: 08/11/2007, 8:51 PM

Couple of issues found in the 3.1.1.0.

1) the SQL below is valid, it executes in MS Access but it does not execute in the Visual Query Builder. I have no idea why:

SELECT Name, Product.Title AS Product, Sales, Target, SalesAndTargets.Sales-SalesAndTargets.Target AS [Delta], IIf([Delta]>0,Delta*1000,100) AS [Target Points],
[Target Points]+CompanyPoints.DisplayPoints+CompanyPoints.BonusPoints+CompanyPoints.TopPoints+CompanyPoints.DiscretionaryPoints AS [Total Points]
FROM (SalesAndTargets INNER JOIN (Shop INNER JOIN (DataPoint INNER JOIN CompanyPoints ON
DataPoint.DataPoint_id = CompanyPoints.DataPointID) ON
Shop.Shop_id = DataPoint.ShopID) ON
SalesAndTargets.DataPointID = DataPoint.DataPoint_id) INNER JOIN Product ON
SalesAndTargets.ProductID = Product.Product_id
WHERE Shop.Shop_id IN (SELECT DISTINCT Shop_id
FROM PromotionCity INNER JOIN ((Shop INNER JOIN (ShopCategory INNER JOIN (PromotionShopCategory INNER JOIN Promotion ON
PromotionShopCategory.PromotionID = Promotion.Promotion_id) ON
ShopCategory.ShopCategory_id = PromotionShopCategory.ShopCategoryID) ON
Shop.CategoryID = ShopCategory.ShopCategory_id) INNER JOIN City ON
Shop.CityID = City.City_id) ON
PromotionCity.CityID = City.City_id
WHERE Promotion.Promotion_id = 1)
AND Product.Product_id IN (SELECT Product_id
FROM (PromotionProduct INNER JOIN Product ON
PromotionProduct.ProductID = Product.Product_id) INNER JOIN Promotion ON
PromotionProduct.PromotionID = Promotion.Promotion_id
WHERE Promotion.Promotion_id = 1)

2) It seems that in VQB if you select to add WHERE clause and use the Expression option, the length of the edit control prevents entering long expressions. For example the following nested select query is truncated

SELECT DISTINCT Shop_id
FROM PromotionCity INNER JOIN ((Shop INNER JOIN (ShopCategory INNER JOIN (PromotionShopCategory

INNER JOIN Promotion ON
PromotionShopCategory.PromotionID = Promotion.Promotion_id) ON
ShopCategory.ShopCategory_id = PromotionShopCategory.ShopCategoryID) ON
Shop.CategoryID = ShopCategory.ShopCategory_id) INNER JOIN City ON
Shop.CityID = City.City_id) ON
PromotionCity.CityID = City.City_id
WHERE Promotion.Promotion_id = {Promotion_id}



View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.