It sounds like you might want "listlen()" of that columnlist, instead of listgetat()? But would it work to just select the max(auditquerytable_id) from auditquerytable? I don't think I understand the situation completely.
-----Original Message----- From: Martin Sutton [mailto:[EMAIL PROTECTED]] Sent: Monday, February 04, 2002 7:59 AM To: CF-Talk Subject: SELECT MAX Problem. Dear all, I am having trouble with the following query: <CFQUERY name="GetLastRecord" datasource="#application.datasrc#"> SELECT MAX(#ListGetAt(evaluate(auditQueryName).Columnlist, 1)#) AS key FROM #auditQueryTable# </CFQUERY> CF gives me an error: Invalid expression format. If I surround it in "" it tries the query: SELECT MAX(UpdateUsers.Columnlist) AS key FROM systemusers This obviously gives me a SQL syntax error. It also is not correct since it seemingly ignores ListGetAt(). I think it is to do with variable resolution ultimately but I am not sure. I want to get the last inserted ID from a different query. Am I going about it the wrong way? Regards, Martin. ______________________________________________________________________ Why Share? Dedicated Win 2000 Server � PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER Instant Activation � $99/Month � Free Setup http://www.pennyhost.com/redirect.cfm?adcode=coldfusionc FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/[email protected]/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

