Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: SQL Expression Syntax Post Reply Post New Topic
Author Message
scottselph
Newbie
Newbie


Joined: 06 Apr 2015
Location: United States
Online Status: Offline
Posts: 1
Quote scottselph Replybullet Topic: SQL Expression Syntax
    Posted: 07 Apr 2015 at 9:03am
I have a Crystal Report connected to a SQL database via an ODBC SQL Server connection. There is a field from this database that I'm trying to retrieve using the SQL Expression below. It does not appear to work as it causes the report to "timeout" and hang up with the status bar continually displaying "accessing database". I'm not sure if the syntax is correct. It is a very convoluted path as there are multiple table that have to link in order to pull the correct piece of data.

I'm dropping this in a group footer. Have been stuck on this issue for days, and it's the last piece I need to complete my report. Any assistance would be GREATLY appreciated.

(
SELECT
MIN(SalesOrderDeliveries.omdDeliveryDate)
FROM dbo.Jobs
INNER JOIN dbo.SalesOrderJobLinks
ON "Jobs"."jmpJobID" = "SalesOrderJobLinks"."omjJobID"
INNER JOIN dbo.SalesOrders
ON "SalesOrderJobLinks"."omjSalesOrderID" = "SalesOrders"."ompSalesOrderID"
INNER JOIN dbo.SalesOrderLines
ON "SalesOrders"."ompSalesOrderID" = "SalesOrderLines"."omlSalesOrderID"
INNER JOIN dbo.SalesOrderDeliveries
ON "SalesOrderLines"."omlSalesOrderID" = "SalesOrderDeliveries"."omdSalesOrderID"
WHERE "SalesOrderDeliveries"."omdShippedComplete" = 0
)
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 08 Apr 2015 at 3:51am
i would not use the SQL expression for this.
Not sure which direction I would recommend yet though.
This would depend on what youa re trying to do and why you are not using the existing data set for that value.
Why is it in the group footer? Are you expecting a unique group result?
are you doing anything with the result or just displaying it?
Is this derviable from the main data set?
What is your current data source? A stored proc? CAn you use an update or cross join in that to get the values at the same time as teh rest of the data set?
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.031 seconds.