dwelsh
|
| Posted: 04/28/2003, 9:46 AM |
|
Im creating a web site for a local golf course. I have to retrieve the last 10 scores, to calculate a handicap.
Does anyone know how I could collect the last 10 entries(scores) a member enters.
Using ASP & Access.
Thanks
David Welsh
|
|
|
 |
EMG
|
| Posted: 04/28/2003, 12:11 PM |
|
select TOP 10 * from GolfTable Order By DateEntered DESC
This will give you the last 10 records entered using a date stamp column, or you could to " Order By RowID DESC ", using your autonumber field.
|
|
|
 |
Deryl
|
| Posted: 04/28/2003, 12:13 PM |
|
David,
Use the TOP specifier in a SQL statement with an order by to get the ten you want. For example, select TOP 10 * from table_name ORDER BY golf_date desc
That's assuming you have a date or sequence number to use to determine the last ten entries. Hope that helps.
Deryl
|
|
|
 |
dwelsh
|
| Posted: 05/01/2003, 8:08 AM |
|
Thanks alot guys that work out perfectly.
Im curious, is there a site somewhere that explains the different SQL syntaxs that can be used.
I am new to using SQL statements.
David Welsh
|
|
|
 |
char
|
| Posted: 05/01/2003, 11:44 AM |
|
www.sql.org has links to many tutorials and documentation.
There is a very good interactive tutorial at http://sqlzoo.net/
HTH
Char
|
|
|
 |
dwelsh
|
| Posted: 05/01/2003, 12:46 PM |
|
Ill check those sites out.
David Welsh
|
|
|
 |