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?

Add your comments

Your Name*:
Your Email:
Site URL:
Site Name:
Comemt Title*:
Your Comment*:
Key Phrase*:
wR9
Your IP Address: 38.103.63.62
 

ScandicWeb is own by Scandic Systems LTD [UK] Company No. 5984000. All other trademarks and copyrights are the property of their respective holders.

[Home [Site Map [Privacy Statement [Site Feedback] [About ScandicWeb]


[ColdFusion [Flash [Search Engine Optimization [Graphics [Cascading Style Sheets (CSS) [JavaScript (JS) [Software]

Partner sites: ScandicSoft


Server time: 19. November 2008 Wednesday