select 1 value from bi.daily_inventory where created_dt = STR_TO_DATE('{date}', '%Y-%m-%d') and code = '{code}' limit 1