Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Idea Please..:)

Author  Topic 

tishri
Yak Posting Veteran

95 Posts

Posted - 2007-07-23 : 07:29:14
Can you help me give me hint how to get the unpaid dates and its balance.

I have almost 500,000 records. So i am really looking for the best query for this .. I tried making a query for this but its very slow.. heheh

[Charges]
Account_No Date Charged Amount Charged
100 6/28/2006 350.00
100 7/28/2006 350.00
100 8/10/2006 350.00
100 9/28/2006 350.00
100 10/12/2006 350.00
100 11/28/2006 350.00
100 12/28/2006 360.00
100 1/6/2007 360.00
100 2/28/2007 360.00

[Payments]
Account No Date Paid Amount Paid
100 11/20/2006 1,750.00
100 2/15/2007 380

[Expected Result]
Account No Date Charged Amount Paid
100 12/28/2006 330.00
100 1/6/2007 360.00
100 2/28/2007 360.00

the query will return those dates that are unpaid and its balance..
:)



TCC

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-07-23 : 07:52:15
what is the expected result ?


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-07-23 : 08:45:04
Maybe you should stick to one issue at a time?
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=86726
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=86031


Peter Larsson
Helsingborg, Sweden
Go to Top of Page
   

- Advertisement -