Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

Code Problem with Nubuilder

Post Reply
at_rcc
Posts: 32
Joined: Thu Sep 02, 2010 11:19 am

Code Problem with Nubuilder

Unread post by at_rcc »

Hi friend , why is this code is not working on the report form while the same code works in then database

____________________________________________________________________
$toDate = msql_date_nq('#vTo#');
$fromDate = msql_date_nq('#vFrom#');

//create 1st table
$sql =
<<<EOSQL

CREATE TABLE #dataTable#
SELECT customer_id,cus_code,cus_name,cus_resp_party,cus_phone,cus_mobile,cus_date_created,
'$toDate' as vTo,'$fromDate' as vFrom ,cus_date_created as date_created_cus FROM customer

LEFT JOIN transaction on transaction.tra_customer_id = customer.customer_id
LEFT JOIN transaction_item ON transaction.transaction_id = transaction_item.tri_transaction_id
LEFT JOIN tbl_batch on tbl_batch.batch_id = transaction_item.batch_id

WHERE DATE(cus_date_created) Between '$fromDate' And '$toDate' order by cus_name asc

EOSQL;
nuRunQuery($sql);
_________________________________________________________________________________

CREATE TABLE ___nu14df0b4c7ced1f___ SELECT customer_id,cus_code,cus_name,cus_resp_party,cus_phone,cus_mobile,cus_date_created, '2011-06-09' as vTo,'2010-05-09' as vFrom ,cus_date_created as date_created_cus FROM customer LEFT JOIN transaction on transaction.tra_customer_id = customer.customer_id LEFT JOIN transaction_item ON transaction.transaction_id = transaction_item.tri_transaction_id LEFT JOIN tbl_batch on tbl_batch.batch_id = transaction_item.batch_id WHERE DATE(cus_date_created) Between '2010-05-09' And '2011-06-09' order by cus_name asc
You do not have the required permissions to view the files attached to this post.
admin
Site Admin
Posts: 2814
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: Code Problem with Nubuilder

Unread post by admin »

When nuBuilder creates a report it does so using #dataTable#.

BUT it adds to that table a field for each parameter on the Run Activity Screen (so that they can be used in the report without manually adding them)
Capture2.PNG
So this..
Capture1.PNG
Becomes this..
Capture.png
In your sql query you are naming another field called vFrom and vTo.

I hope this helps

Steven
You do not have the required permissions to view the files attached to this post.
Post Reply