Skip to main content
February 24, 2011
Question

Two Queries before INSERT statement.

  • February 24, 2011
  • 1 reply
  • 340 views

Hi,

Can I use a two Queries back to back before a Insert statement, and in the values part use values from both the queries using query1.name from the first query and query2.date from the second query? Is there a special format that I have to use or i can just say FORM.name for inside query and query1.date for the outer query. It is of the form:

<cfquery name = query1....>

<cfquery name=query2...>

Insert Into(name,

                Date)

Values(#FORM.query2#,

           #query1.date#);

Thanks in advance.

Vijay.

    This topic has been closed for replies.

    1 reply

    Inspiring
    February 25, 2011

    Yes you can.

    The one thing to watch out for when referencing query results is to specify the row number.