BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

SQL Server 2005 query Problem

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (SQL Servers)
View previous topic :: View next topic  
Author Message
Rhea Grason
Guest





PostPosted: Wed Apr 25, 2007 12:44 am    Post subject: SQL Server 2005 query Problem Reply with 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:

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





PostPosted: Wed Apr 25, 2007 5:10 am    Post subject: Re: SQL Server 2005 query Problem Reply with quote



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





PostPosted: Wed Apr 25, 2007 8:14 pm    Post subject: Re: SQL Server 2005 query Problem Reply with quote



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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (SQL Servers) All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.