vicissitude
Registered User.
- Local time
- Today, 15:59
- Joined
- Feb 28, 2010
- Messages
- 92
I wonder if someone could help me with this....
I have a table of names with start dates and leave dates, the leave dates may or may not exist depending on if they are still current. How would i go about writing a query to include names that have a start date before a specified date and have a leave date after that spedified date but still include them if the leave date is null?
On the start date field i used a subquery to get the specified date (from a table) and then tested if start date was before this date and this worked fine. The problem came when i tried to do the same with the leave date, it was fine if a leave date existed, it would include all records that had a leave date after the specified date but when the leave date was null it returned no records.
Can anyone tell me the best way to deal with nulls in this circumstance?
thanks.
I have a table of names with start dates and leave dates, the leave dates may or may not exist depending on if they are still current. How would i go about writing a query to include names that have a start date before a specified date and have a leave date after that spedified date but still include them if the leave date is null?
On the start date field i used a subquery to get the specified date (from a table) and then tested if start date was before this date and this worked fine. The problem came when i tried to do the same with the leave date, it was fine if a leave date existed, it would include all records that had a leave date after the specified date but when the leave date was null it returned no records.
Can anyone tell me the best way to deal with nulls in this circumstance?
thanks.