Quantcast
Channel: Answers for "Problem with Between dates and Null values"
Browsing all 6 articles
Browse latest View live

Answer by Tim

How about WHERE (date BETWEEN records.Start_Date AND records.End_Date) OR records.End_Date IS NULL If you also want records with a Start_Date greater than a certain date and where End_Date is NULL then...

View Article



Answer by Mark

Since you can't say BETWEEN a date and a NULL value, you can slightly change this to say: WHERE (date BETWEEN records.Start_Date AND records.End_Date) OR ( date >= records.Start_Date AND...

View Article

Answer by Kev Riley

I prefer where date is between records.Start_Date and isnull(records.End_Date, date) which is somewhat like what you originally tried to write with your OR statement

View Article

Answer by Tim

How about WHERE (date BETWEEN records.Start_Date AND records.End_Date) OR records.End_Date IS NULL If you also want records with a Start_Date greater than a certain date and where End_Date is NULL then...

View Article

Answer by Mark

Since you can't say BETWEEN a date and a NULL value, you can slightly change this to say: WHERE (date BETWEEN records.Start_Date AND records.End_Date) OR ( date >= records.Start_Date AND...

View Article


Answer by Kev Riley

I prefer where date is between records.Start_Date and isnull(records.End_Date, date) which is somewhat like what you originally tried to write with your OR statement

View Article
Browsing all 6 articles
Browse latest View live




Latest Images