Whats the error your getting?

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Stuart Kidd
Sent: Sunday, 6 April 2003 12:50 AM
To: CFAussie Mailing List
Subject: [cfaussie] Retrieving Last Record Inserted.


Hi guys,

I'm trying to find out what the last record number was that I inserted
but am coming up with some errors.  I first have inserted the fields and
then I am calling another query to select the max row.  Can anybody shed
any light on this.

<cfquery name="InsertNewProperty" datasource="MyTotalHouses">
 insert into properties (propertyfirstname, propertylastname,
propertytype, propertytitle, propertynumberofbedrooms, propertytown,
propertystate, propertycountry, propertyowneremailaddress,
propertyprice, propertypriceperiod, propertypricecurrency,
randomconfirmationnumber)
values ('#form.propertyfirstname#', '#form.propertylastname#',
'#form.propertytype#', '#form.propertytitle#',
'#form.propertynumberofbedrooms#', '#form.propertytown#',
'#form.propertystate#', '#form.propertycountry#',
'#form.propertyowneremailaddress#', '#form.propertyprice#',
'#form.propertypriceperiod#', '#form.propertypricecurrency#',
'#randomconfirmationnumber#')
</cfquery>

<cfquery datasource="MyTotalhouses" name="GetID">
 SELECT MAX(ID) AS ThisID
 FROM Properties
</cfquery>

<cfoutput>Last record number inserted: #GetID.ThisID#</cfoutput>

Thanks very much.

Stu



---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]

MX Downunder AsiaPac DevCon - http://mxdu.com/


---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]

MX Downunder AsiaPac DevCon - http://mxdu.com/

Reply via email to