 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Rhea Grason Guest
|
Posted: Wed Apr 25, 2007 12:44 am Post subject: SQL Server 2005 query Problem |
|
|
I can run this query in SQL Explorer no problem (Delphi 5) but when I run it from my app it won't open, the app just hangs. Any ideas? Here is the query:
Select I.Reqdate, (I.Reqdate - L.Days) As Shipdate, O.Custnum, C.Company1, O.Ordstatus, O.Freight, I.Ordernum, I.Item, I.Prodcode, I.Splitprod, SUM(P.Blocks) As Shipped, I.Splitprod - SUM(P.Blocks) As Balance, PR.Desc50, PR.PCType, L.Days from Product PR, Customer C LEFT OUTER JOIN LeadTime L ON (C.Prov = L.Prov) JOIN Orders O ON (C.Custnum = O.Custnum) JOIN Orditem I ON (O.Ordernum = I.Ordernum) LEFT OUTER JOIN PsDetails P ON (I.Ordernum = P.Ordernum and I.Item = P.Item) LEFT OUTER JOIN Packslip S on (P.Packingslip = S.Packingslip) where I.Location = 1 and O.Ordstatus = 2 and (I.Reqdate - L.Days) <= '20070423' and I.Prodcode = PR.PRodcode and O.Custnum <> 7993 and O.Custnum <> 7053 Group By I.Ordernum, I.Item, I.Prodcode, PR.Desc50, PR.PCtype, O.Custnum, C.Company1, I.Reqdate, O.Ordstatus, O.Freight, I.Splitprod, L.Days Having ((I.Splitprod - SUM(P.Blocks)) > 0 or (SUM(P.Blocks) is null)) and I.Splitprod > 0 Order By 2, 1
Thanks. |
|
| Back to top |
|
 |
Oliver Townshend Guest
|
Posted: Wed Apr 25, 2007 5:10 am Post subject: Re: SQL Server 2005 query Problem |
|
|
| Quote: | I can run this query in SQL Explorer no problem (Delphi 5) but when I run
it from my app it won't open, the app just hangs. Any ideas? Here is the
query:
|
Are you expecting a lot of rows? Does your app download the lot? Are there
reserved words? How long does it take in Management Studio?
Oliver Townshend |
|
| Back to top |
|
 |
Rhea Grason Guest
|
Posted: Wed Apr 25, 2007 8:14 pm Post subject: Re: SQL Server 2005 query Problem |
|
|
The query returns 218 rows but will often return less than that. It takes 2 seconds to execute in Management Studio. It gives this message when executed: Warning: Null value is eliminated by an aggregate or other SET operation. I don't think there are any reserved words.
| Quote: | Oliver Townshend<oliveratcodelegaldotcomdotau> 04/24/2007 6:10 PM
I can run this query in SQL Explorer no problem (Delphi 5) but when I run
it from my app it won't open, the app just hangs. Any ideas? Here is the
query:
|
Are you expecting a lot of rows? Does your app download the lot? Are there
reserved words? How long does it take in Management Studio?
Oliver Townshend |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|