PHP/PDO/MySQL if statement in BETWEEN clause -


i'm trying return records records store within date range. however, if store opened after date, want use open date. possible this? i'm using php pdo , mysql:

select    store_name,    daily_sales    mytable    date between (if(open_date > :start_date, open_date, :start_date) , :end_date 

so can this:

select    store_name,    daily_sales    mytable    date between (select if(open_date > :start_date, open_date, :start_date)) , :end_date 

Comments

Popular posts from this blog

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

java - Why does my date parsing return a weird date? -

Need help in packaging app using TideSDK on Windows -