Hi,
I have a report which lists current orders by date. I need to highlight the current Order which is in progress.
The following displays the current order (bgm) being worked on:
declare vCurrentBGM varchar(11);
SELECT bgm AS vCurrentBGM FROM syflux_archives.table_msg WHERE pm_date <> 0 ORDER BY pm_date DESC LIMIT 1;
I then have another select statement to produce my listing of all Orders.
SELECT DATE_FORMAT(dtm234,'%Y-%m-%d %H:%i') as 'Coll Date', dtm76 AS 'Delivery Date', bp.reference AS 'Part',
bgm AS 'Manifest', COUNT(plq_1004) AS 'Qty', tcm.dernier_rack_camion AS 'Start Seq', tcm.premier_rack_camion AS 'End Seq',
IF (msg.num_camion > 0,msg.num_camion,'') AS 'Shipment', IF(msg.num_camion <> 0,CONCAT(MID(ref_on,8,2),RIGHT(ref_on,6)),'') AS 'ASN',
DATE_FORMAT(delivery_date,'%Y-%m-%d %H:%i') as 'Shipped', msg.pdsn AS 'PDSN', null as 'nullcolumn'
FROM syflux_archives.table_msg AS msg LEFT JOIN syflux_archives.table_camions AS tcm ON msg.num_camion = tcm.num_camion
LEFT JOIN syflux_archives.base_produit AS bp ON bp.reference = msg.plq_7304
WHERE DATE_FORMAT(STR_TO_DATE(LEFT(dtm,8), '%Y%m%d'), '%Y-%m-%d') >= DATE_FORMAT(vStartDate, '%Y-%m-%d') AND msg.rack = 'RACK_FEM'
GROUP BY bgm, msg.num_camion
ORDER BY processorder, bgm, msg.num_camion;
How do I then highlight the current Order being worked on in the second select statement. Can I put the value from the first select statement into a global variable and then compare it with the values in the second select statement and change its colour to Green if the same?
Hope you can help.
Thanks,
Stu