|
|
|
SSC Veteran
      
Group: General Forum Members
Last Login: Today @ 1:18 PM
Points: 215,
Visits: 610
|
|
I think you can use the following sql to do your work select * from My_Table where col_date between isnull(@Start_Date, '1900-01-01') and isnull(@End_Date, '2999-01-01') Assume your real date is no earlier than '1900-01-01' and no later than '2999-01-01')
|
|
|
|
|
SSC Eights!
      
Group: General Forum Members
Last Login: Tuesday, May 21, 2013 11:18 AM
Points: 848,
Visits: 1,453
|
|
David, You say that dropping the support for the WHERE clause is breaking away from the ANSI standard. It is the ANSI standard that has pshed the move to using the FROM clause for Joins and not the WHERE clause. Based on that how would this move by Microsoft be considered a move away from the ANSI standard? Even if the latest standard allows for joins in the FROM and WHERE clause the fact that the preferred method of joins is in the FROM clause I would think that sticking with usisng the WHERE clause would actually be a move away from the ANSI standard. PLease understand that I am not trying to sound negative or attack your comment, I know personally how emails and postings are poor at properly conveying emotions. I am merely trying to understand why you feel this way and try to find out if maybe I have missed something or have improperly understood the ANSI standard. Thanks Ed
Kindest Regards,
A Democracy works great until the day you find yourself on the sheep side of a vote between 5 wolves and 4 sheep on what’s for dinner when neither have eaten in many days. A free Republic where the rights of the few and the individual are protected is the only one in which Freedom and Prosperity for all have a chance to blossom.
|
|
|
|
|
Mr or Mrs. 500
      
Group: General Forum Members
Last Login: Tuesday, June 21, 2011 10:03 AM
Points: 577,
Visits: 102
|
|
|  | BETWEEN is purely simpler to read. There is no specific engine enhancements that make BETWEEN any faster. |
|
| 2cents more..."Between" is not ANSI 92 standard, so using < and > is more portable.
Signature is NULL
|
|
|
|
|
Grasshopper
      
Group: General Forum Members
Last Login: Wednesday, December 19, 2012 4:27 PM
Points: 12,
Visits: 20
|
|
Hi You can write query like this: suppose say you are passing two parameters name @StartDate and @EndDate and you column name in table is TransDate TransDate BETWEEN ISNULL(@StartDate, TransDate) AND ISNULL(@EndDate, TransDate) 
Rohit
|
|
|
|
|
SSC Rookie
      
Group: General Forum Members
Last Login: Wednesday, February 06, 2013 3:04 PM
Points: 38,
Visits: 417
|
|
| One of the poorest articles I have read in the long time. Theta join is by no means an exotic operator. Set equality and set containment join is. Google "relational division"
|
|
|
|