Is there some way to display empty fields or some default value for fields when I get no records found?
I want to maintain the look of my screen even when there are no records to display.
My own efforts have proven to be quite difficult to accomplish.
See Attached… I don’t want the “Records not found” parts… instead in order to make the Warehouse Grid filled in even when there are no records I had to create another table just like the warehouse table and then populate it with the default values, then use a long query to get it to fill in the blanks when there are any. In this case I wanted it to display all 3 warehouses, even if there were only records for two of them.
My Other tables will just not have records for that ItemCode…
Ill Attach Screenshots of my tables and here’s the MySQL Im using.
[SIZE=10px]
SELECT
coalesce (w.WarehouseCode,Mast.WarehouseCode) as WarehouseCode,
coalesce (w.QuantityOnHand,Mast.QuantityOnHand) as QuantityOnHand,
coalesce (w.QuantityOnSalesOrder,Mast.QuantityOnSalesOrder) as QuantityOnSalesOrder,
coalesce (w.QuantityOnPurchaseOrder,Mast.QuantityOnPurchaseOrder) as QuantityOnPurchaseOrder,
coalesce (w.QuantityOnBackOrder,Mast.QuantityOnBackOrder) as QuantityOnBackOrder
FROM
IM_ItemWarehouse_Master Mast
left join
IM_ItemWarehouse w on
w.WarehouseCode = Mast.WarehouseCode
AND w.Itemcode = '[ATRNUM]'
Order by WarehouseCode
[/SIZE]