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.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2001-01-15 : 08:16:02
|
Jon writes "I am a newbie to sql server and vb programming (only been doing it for 3 months), and i have problem with the speed of my program:
AdoRS_sales2.Open "select sum(sduprc * sdsoqs) as total from sales2000 where sdsoqs <> '0' and not sdsoqs like '-%' And sdglc = 'IN03' And sdan8 = " & AdoRS_sales1!sdan8 & " and datepart(m,sdivd) = " & month & " and datepart(yyyy,sdivd) = " & year, AdoConn_Sales
If AdoRS_sales2!total <> Null Or AdoRS_sales2!total <> 0 Then xlBook.ActiveSheet.Cells(2 + i, 4).Value = CLng(AdoRS_sales2!total) Else xlBook.ActiveSheet.Cells(2 + i, 4).Value = 0 End If
AdoRS_sales2.Close
ok, here is what i am trying to do in english I have to search through a table with about 500000 records and import the data into an excel worksheet (the queries work out sales figures for different product groups).
the query does a sum on the columns sduprc(unit price) and sdsoqs(quantity). sdan8 is an account number worked out from another query.
The problem is that each of these queries takes about 4 seconds, and each of these queries needs to be processed for about 250 accounts ( each with about 10 different product groups SDGLC)...any type of help will be appreciated. Thanks for taking the time to read this. " |
|
|
|
|
|