October 4th, 2011, 01:18 PM
Simple Loop Query
Have been on this project too long ... trying to reconcile credit card batch statement line items to actual orders. Data tables is on different dsn's.
The parent query loads fine:
<cfquery datasource="#request.datasource#" name="recon">
(ID >= #(form.startdate)#) AND (ID <= #(form.enddate)#)
Order By ID
<cfquery name="reg" datasource="data2">
WHERE Extra3 = '#recon.extra3#'
Order By Extra3
<table width="800" cellspacing="4" cellpadding="4" summary="" border="0">
***********data from recon **************
now want to display child records for each line above directly underneath each parent.
In a nutshell ... Data from Commerce table alternating with data from Alpiner table ... have tried looping joins ... major league code blindness coupled with serious brain fart.
October 4th, 2011, 03:34 PM
All you should need is a JOIN. Depending on your database type and permissions, it may be possible to do it directly. Otherwise, try doing the JOIN in a QoQ.
Originally Posted by frapple
I am guessing that is psuedo-code ... But if you are really not using cfqueryparam - you should start. At the very least to help protect your financial data against sql injection.