Link to home
Start Free TrialLog in
Avatar of Quack
QuackFlag for United States of America

asked on

SQL code commented out within Cold Fusion - Not sure if it is being executed while its w/in the <!--- ---> brackets.

I have a sql query w/in Cold Fusion I'm confused about. The colorization of the commented out code isn't showing correctly within dreamweaver:

[code][/<cfquery name="vp" datasource="casprod">
select c.org_id orgid, c.vendor_name vendor, c.address_line1 addr1, c.address_line2 addr2, c.address_line3 addr3,c.city city,c.state state, substr(c.zip,1,5) zip, c.country country, substr(d.attribute1,1,2) doctype, sum(d.amount) tot_amount, count(distinct c.check_id) count
from ap.ap_checks_all c, ap.ap_invoice_payments_all p, ap.ap_invoice_distributions_all d, ap.ap_invoices_all i
where  c.payment_method_lookup_code='CHECK'
and c.amount <> 0
and c.check_id = p.check_id
and p.invoice_id= d.invoice_id
and d.invoice_id = i.invoice_id
and c.status_lookup_code = 'NEGOTIABLE'
and c.org_id =101
and i.source <> 'MILITARY PAY'
and c.check_date >= TRUNC(ADD_MONTHS(SYSDATE, -1),'MM')
and c.check_date <= LAST_DAY(ADD_MONTHS(SYSDATE, -1))
group by c.org_id,c.attribute8,c.vendor_name,c.address_line1,c.address_line2, c.address_line3,c.city,c.state,c.zip,c.country,substr(d.attribute1,1,2)
order by 3

<!---select c.org_id orgid, c.attribute8 attrib8, c.vendor_name vendor, c.address_line1 addr1, c.address_line2 addr2, c.address_line3 addr3,c.city city,c.state state, substr(c.zip,1,5) zip, c.country country, substr(d.attribute1,1,2) doctype, sum(d.amount) tot_amount, count(distinct c.check_id) count
from ap.ap_checks_all c, ap.ap_invoice_payments_all p, ap.ap_invoice_distributions_all d
where  c.payment_method_lookup_code='CHECK'
and c.amount <> 0
and c.check_id = p.check_id
and p.invoice_id= d.invoice_id
and c.status_lookup_code = 'NEGOTIABLE'
and c.org_id =101
and c.check_date >= TRUNC(ADD_MONTHS(SYSDATE, -1),'MM')
and c.check_date <= LAST_DAY(ADD_MONTHS(SYSDATE, -1))
group by c.org_id,c.attribute8,c.vendor_name,c.address_line1,c.address_line2, c.address_line3,c.city,c.state,c.zip,c.country,substr(d.attribute1,1,2)
order by 3--->
</cfquery>code]

That's the full query but my question is regarding the commented section. If I pull that section out will that affect the other query? I'm getting better at sql but confused as to why this would be set up like this. Thanks for your help.
SOLUTION
Avatar of gdemaria
gdemaria
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of LajuanTaylor
LajuanTaylor

The only difference between both queries appears to be the status lookup code. See attached images.
query_1.jpg
query_2.jpg
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
These comments answer the question about the commented select-clause in the cfquery