Forums
This topic is locked
limit Maximum records in recordset
20 Mar 2004 19:16:24 phil C posted:
is there a simple way to limit the total number of records contained within a recordset, the database contains over 35000 records and i need to be able to set a maximum number that can be retrived at any one time. Replies
Replied 20 Mar 2004 21:07:26
20 Mar 2004 21:07:26 Phil Shevlin replied:
What database are you using? Are you just trying to avoid displaying the 35000 records, or retrieving them all together?
If you just want to avoid showing them - use recordset paging.
If you want to avoid retrieving them:
MYSql uses LIMIT
SQL uses TOP
If you just want to avoid showing them - use recordset paging.
If you want to avoid retrieving them:
MYSql uses LIMIT
SQL uses TOP
Replied 21 Mar 2004 23:51:36
21 Mar 2004 23:51:36 phil C replied:
Hi
im using access 2000 with windows 2003 server
i need to restrict the number of returned records on a standard account to 1000 and 5000 on a payed account. otherwise im just giving away all my hard work compling the data.
im using access 2000 with windows 2003 server
i need to restrict the number of returned records on a standard account to 1000 and 5000 on a payed account. otherwise im just giving away all my hard work compling the data.
Replied 21 Mar 2004 23:58:29
21 Mar 2004 23:58:29 Phil Shevlin replied:
I think this will work in Access
SELECT TOP 1000...
SELECT TOP 1000...
Replied 22 Mar 2004 00:05:22
22 Mar 2004 00:05:22 phil C replied:
using this code
SELECT TOP 1000
FROM casedata
WHERE ((casedata.regdate<=Date()-42))
Got this error
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC Microsoft Access Driver] The SELECT statement includes a reserved word or an argument name that is misspelled or missing, or the punctuation is incorrect.
/tri/result.asp, line 92
Edited by - filco on 22 Mar 2004 00:07:19
SELECT TOP 1000
FROM casedata
WHERE ((casedata.regdate<=Date()-42))
Got this error
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC Microsoft Access Driver] The SELECT statement includes a reserved word or an argument name that is misspelled or missing, or the punctuation is incorrect.
/tri/result.asp, line 92
Edited by - filco on 22 Mar 2004 00:07:19
Replied 22 Mar 2004 00:16:22
22 Mar 2004 00:16:22 phil C replied:
OK
got it working, missed out the *
Thanks for all your help.
got it working, missed out the *
Thanks for all your help.
Replied 22 Mar 2004 00:16:44
22 Mar 2004 00:16:44 Phil Shevlin replied:
SELECT TOP 1000 casedata.*
FROM casedata
WHERE ((casedata.regdate<=Date()-42))
FROM casedata
WHERE ((casedata.regdate<=Date()-42))