problem in Query formation

S

subbu

Hi,
I am using top command to select rows from the table
based on the condition.The query is returning 1 row
instead of 5 rows.

If i remove the where clause query retrieves 5 rows.

This is my query

ssql = "SELECT TOP " & iRowsSelected & " ACCT_AGRMT_SVCC.*
FROM ACCT_AGRMT_SVC WHERE Used =" & 0

here iRowsSelected is no of rows that is to be selected

Your suggestions is highly appreciated

subbu
 
J

John Spencer (MVP)

Well, if the where clause is limiting the records returned to 1 then the TOP has
no real meaning if iRowsSelected in greater than 1.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top