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

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -