ColdFusion Tutorial
How to get the ID of the last record in an Access table
If the ID is AutoNumber, Access or SQL always assigns the next ID greater than the last. And that make this easy.
Example code:
|
<!--- Use the MAX() function to get the greatest value. ---> < cfquery name = "last_record" datasource = "your_datasource">Select MAX(your_table_ID) AS ThisID From your_table </ cfquery>< cfset LastID = last_record.ThisID> |
The MAX function returns the maximum value of an expression.
The syntax for the MAX function is:
|
SELECT MAX (expression ) FROM tables WHERE predicates; |
ColdFusion Tutorial test
How to get the ID of the last record in an Access table
No test is available or implemented for this ColdFusion Tutorial.
No User Comments.
No User Comments, be the first one to write your comments?
