Try this Nelson:

<cftransaction>
<cfquery ....>
        insert into myTable1 ( ..... )
        values ( ..... )
</cfquery>
<cfquery ....>
        SELECT MAX(SomeID) AS NewSomeID
        FROM myTable2
</cfquery>
</cftransaction>

Using cftransaction insures that you get the newest SomeID inserted.

Duane Boudreau,
Project/Beta Manager, eMPower
Director, Web Technologies
Ektron, Inc.
http://www.ektron.com
5 Northern Blvd, Suite 6
Amherst, NH 03031
Tel: 603-594-0249
Fax: 603-594-0258



>From: Nelson Sauve <[EMAIL PROTECTED]>
>Reply-To: [EMAIL PROTECTED]
>To: cf-talk <[EMAIL PROTECTED]>
>Subject: SQL Max record ID ?
>Date: Mon, 08 May 2000 11:28:50 -0700
>
>Hello,
>
>I have two tables Table #1 has an automatic increment field (someID).
>
>When I add a new record to Table #1 I want to take that someID field
>just created and use it in Table2 (separate templates) when I create a
>record for Table #2. That is I want the maximum value for someID in the
>table.
>
>Can anyone help ?
>
>Thanks,
>Nelson
>
>
>---------------------------------------------------------------------------
---
>Archives: http://www.eGroups.com/list/cf-talk
>To Unsubscribe visit
>http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
>send a message to [EMAIL PROTECTED] with 'unsubscribe' in
>the body.

________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com

----------------------------------------------------------------------------
--
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.

------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to