$query =" SELECT * FROM list LEFT OUTER JOIN
[192.168.247.29].[DATA_PRODUCT].[dbo].[MY_BARCODE] on list.BARCODE = MY_BARCODE.BARCODE collate Thai_CI_AS LEFT OUTER JOIN
status ON list.statusid = status.statusid LEFT OUTER JOIN
store ON list.storeid = store.storeid LEFT OUTER JOIN
inbound ON list.inboundid = inbound.inboundid LEFT OUTER JOIN
note ON list.noteid = note.noteid LEFT OUTER JOIN
inventory ON list.inventoryid = inventory.inventoryid LEFT OUTER JOIN
returnproduct ON list.returnid = returnproduct.returnid WHERE (datein BETWEEN (echo$_SESSION["datein1"]) AND (echo$_SESSION["datein2"]))
ORDER BY list.datein DESC ";
$result = odbc_exec($conn,$query) or die(odbc_error($conn));