How to use default time function in metabase

SELECT a_offer.name as Engagement Name, count(*) count
FROM u_user_offer_detail_record
left join a_offer on a_offer.id = u_user_offer_detail_record.offer_id
WHERE 1
and update_time_ms>= UNIX_TIMESTAMP([[{{start_date}} #]] date(Now()-Interval 1 DAY)) * 1000
and update_time_ms<= UNIX_TIMESTAMP([[{{end_date}} #]] Now()) * 1000
and award_status=12
and u_user_offer_detail_record.adset_id = [[{{adset_id}} #]]1459904136457728
group by a_offer.name
order by count desc

I want to user datetime picker, if not use default date, but it can't work when select date, How can I do?

Hi @thundery
I'm guessing that you're using MySQL.
You don't need to use complex default values, but just slightly more interesting use of optional clauses.
Example:

and update_time_ms >= UNIX_TIMESTAMP(coalesce([[{{start_date}},]] date(Now()-Interval 1 DAY))) * 1000

That's great!Thank you very much!