SELECT jobnum,tbl_borrow.itemnum,tbl_borrow.running_num,tbl_borrow.laborcode,
date_borrow, qtydateborrow, Date() AS now_date
DateAdd("d", qtydateborrow, date_borrow) AS sum_date,
(IIF(DateAdd('d',qtydateborrow, date_borrow) > Date(),
'ไม่เกินกำหนดระยะยืม', 'เกินกำหนดระยะยืม')) AS result FROM tbl_borrow
INNER JOIN tbl_tool ON
(tbl_borrow.itemnum = tbl_tool.itemnum) where
laborcode= '" & laborcode & "' and tbl_borrow.status not like'complete'