Help on time stamp and reports
Posted: Thu Oct 14, 2010 9:53 am
Hi i have the following sql which works perfectly in a form but when i try to use the same in report it is not working
secondly how do we compare date when the field is time stamp ?
SELECT *
FROM customer
INNER JOIN transaction on customer.customer_id = transaction.tra_customer_id
LEFT JOIN transaction_item on transaction_item.tri_transaction_id = transaction.transaction_id
LEFT JOIN tbl_batch on tbl_batch.batch_id = transaction_item.batch_id
===============================================>
$toDate = msql_date_nq('#vTo#');
$fromDate = msql_date_nq('#vFrom#');
$sql =
<<<EOSQL
CREATE TABLE #dataTable#
SELECT *
FROM customer
INNER JOIN transaction on customer.customer_id = transaction.tra_customer_id
LEFT JOIN transaction_item on transaction_item.tri_transaction_id = transaction.transaction_id
LEFT JOIN tbl_batch on tbl_batch.batch_id = transaction_item.batch_id
EOSQL;
nuRunQuery($sql);
---------------------------------------------->
help would be very much appreciated
secondly how do we compare date when the field is time stamp ?
SELECT *
FROM customer
INNER JOIN transaction on customer.customer_id = transaction.tra_customer_id
LEFT JOIN transaction_item on transaction_item.tri_transaction_id = transaction.transaction_id
LEFT JOIN tbl_batch on tbl_batch.batch_id = transaction_item.batch_id
===============================================>
$toDate = msql_date_nq('#vTo#');
$fromDate = msql_date_nq('#vFrom#');
$sql =
<<<EOSQL
CREATE TABLE #dataTable#
SELECT *
FROM customer
INNER JOIN transaction on customer.customer_id = transaction.tra_customer_id
LEFT JOIN transaction_item on transaction_item.tri_transaction_id = transaction.transaction_id
LEFT JOIN tbl_batch on tbl_batch.batch_id = transaction_item.batch_id
EOSQL;
nuRunQuery($sql);
---------------------------------------------->
help would be very much appreciated