Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Get Record in Date-Range

Author  Topic 

gpc44
Starting Member

35 Posts

Posted - 2014-07-04 : 09:45:49
I have this Date Values ??(DateFrom, DateUntil) selected, which lie in the current Date Range - or in the future.
Now I would like to have:
- If getdate () between Date From and DateUntil, then take this.
- If there is only future values??, then take the most obvious diagnosis suggests most value.

---------------------------------
DateFrom DateUtil
2011-09-01 2014-08-31
2014-09-01 2014-10-31
2014-11-01 2015-06-30
2015-07-01 NULL
----------------------------------

Regards
Nicole

Lamprey
Master Smack Fu Yak Hacker

4614 Posts

Posted - 2014-07-07 : 15:59:17
quote:
Originally posted by gpc44

- If there is only future values??, then take the most obvious diagnosis suggests most value.

What does that mean? What's an "obvious diagnosis" in the context of your question?
Go to Top of Page
   

- Advertisement -