General information
Forum:
Microsoft SQL Server
Category:
Database management
Title:
Is one way more efficient than the other
Environment versions
SQL Server:
SQL Server 2005
Hello all,
I have a stored procedure that is used for a report that needs to return rows based on selection criteria passed as parameters. Two of the parameters are datetime fields. The parameters are testing for a from date and to date based on one datetime field in a view.
Is either one of these more efficient:
1.) where tradeDate >= @FromDate and tradeDate <= @ToDate OR
2.) where tradeDate between @FromDate and @ToDate
Now I do have an index on this datetime field (which will always have midnight as the time).
Any ideas or suggestions are appreciated.
Thanks.
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only