I believe with Access you need to alias the MAX() function. <cfquery name="verify" datasource="mod"> select max(pk_id) AS MAXID from users where email = '#session.email#' </cfquery>
On 6/13/06, Jeff Sabarese <[EMAIL PROTECTED]> wrote: > i've been through a few different conversations on the topic of "how do I > most easily retrieve the Primary Key of the 'last Insert Query'" > > i settled on this one to try for an ms access database (because, using CFMX > 6.1 on Linux, i was enjoying my time w/ MySQL-- only to later realize that my > SQL wasn't compatible... oops!) > > there error is as shown, taken directly from the debug: > > Too few parameters. Expected 1. > > The error occurred in C:\Apache2\Apache2\htdocs\XXXXXX\report_page1.cfm: line > 38 > > 36 : > 37 : <cfquery name="verify" datasource="mod"> > 38 : select max(pk_id) from users where email = '#session.email#' > 39 : </cfquery> > 40 : > > so, what am i missing there? or, is something missing in the table itself? > thanks! > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:243429 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54