Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello, please help if possible.
Does anyone know what the SQL string would look like to return ALL columns for a specific number of rows (or just the top row) of an Access DB (along with the headers)? I've tried things like: SELECT * FROM [TABLE] WHERE ROWNUM = 1; but Access apparently doesn't use "ROWNUM". Your example string would be most helpful. TIA. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Quartz,
You can use the TOP n expression to do that. Basically, the database will return the top n row(s) that meet the criteria. For example, if you wanted the top 5 records from a table named tblEmployees where the employee's last name starts with "S", you would do this: SELECT TOP 5 * FROM tblEmployees WHERE LastName LIKE 'S*' ORDER BY LastName ASC -- Regards, Jake Marx MS MVP - Excel www.longhead.com [please keep replies in the newsgroup - email address unmonitored] Quartz wrote: Hello, please help if possible. Does anyone know what the SQL string would look like to return ALL columns for a specific number of rows (or just the top row) of an Access DB (along with the headers)? I've tried things like: SELECT * FROM [TABLE] WHERE ROWNUM = 1; but Access apparently doesn't use "ROWNUM". Your example string would be most helpful. TIA. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Return a String in a 7 Row Range Q | Excel Worksheet Functions | |||
return first TWO or THREE words in string | Excel Discussion (Misc queries) | |||
return 1st word in string | Excel Discussion (Misc queries) | |||
return an empty string in VBA | Excel Discussion (Misc queries) | |||
return partial string | Excel Worksheet Functions |