January 18, 2008 at 2:17 am
Hi all,
I have two tables in my table startDate and Enddate. I want to check whether a given date is avalible in between the startDate and
Enddate.How can I. some times the startDate or Enddate may be null. How can I ?
Thanks
Dana
January 18, 2008 at 8:56 am
Are there referenced columns in these two tables?
January 18, 2008 at 9:35 am
Select
*
from
MyTable
where
@MyDate > StartDate and @MyDate < EndDate
January 18, 2008 at 11:04 am
Just curious... I can see where a NULL end date could be interpreted as 31 Dec 9999, but what does a NULL start date indicate other than something hasn't started? And, do you have the possibility of (incorrectly, I believe) having a NULL start date and a non-null end date?
--Jeff Moden
Change is inevitable... Change for the better is not.
January 18, 2008 at 12:33 pm
Jeff Moden (1/18/2008)
...but what does a NULL start date indicate other than something hasn't started?...
Depends on how you use NULL. It could mean does not exist, does not apply, or do not know.
It could be for an application that you can just not know a value, even though it logically has to exist.
You might ask a customer for information that they refuse to give, but you still want their business.
Sales Rep: "May I have your birthday, please?"
Customer: "No."
That has always been one of the criticisms of the use of NULL; there can be multiple reasons why it is NULL. If it is important, then the application should capture why it is NULL.
January 18, 2008 at 12:53 pm
Heh... yep, I knew that Michael... sorry I didn't state things clearly... I wanted to know the condition of the OPs data.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply