У меня есть следующий sql-запрос, который работает. Однако мне нужна помощь с полями, которые имеют расчет/10000. Иногда в поле не будет данных, поэтому мой запрос ниже возвращает 0. Как проверить данные> 0 перед выполнением вычисления/10000?Заявление sql с if внутри?
SELECT
timesheet.customerID,
customer.customer,
timesheet.projectID,
project.project_title,
timesheet.chargeID,
charge.charge_description,
timesheet.notes,
timesheet.mon/10000,
timesheet.tues/10000,
timesheet.wed/10000,
timesheet.thurs/10000,
timesheet.fri/10000,
timesheet.sat/10000,
timesheet.sun/10000,
timesheet.lineID
FROM
timesheet_line timesheet
LEFT JOIN customer ON timesheet.customerID = customer.customerID
LEFT JOIN project ON timesheet.projectID = project.projectID
LEFT JOIN charge_rate charge ON timesheet.chargeID = charge.chargeID
WHERE
timesheet.timesheetID = '" & tTimesheetID & "' --VBA variable added here
ORDER BY
timesheet.lineID