In my query i have cast and convert functions,which made my query run for long time.
When i removed those functions and replaced them with day/month/year functions and concatenated them for getting a format of date
which took less time.
Is this because convert() or cast() takes more execution time ?
Thank you
in advance

Mukesh Kumar TiwariRank #1,773 · 844 reputationPosted Jan 23, 2015, 4:52 AM EST
VulpesRank #55 · 29.2K reputationPosted Jan 23, 2015, 5:23 AM EST
Of course, you get similar discrepancies when using 'library functions' from any programming language (not just domain-specific ones such as SQL). Sometimes it's much more performant to do things in a certain way.
Manish Kumar ChoudharyRank #339 · 7.4K reputationPosted Jan 23, 2015, 5:28 AM EST
Vikrant MoreRank #1,157 · 1.6K reputationPosted Feb 15, 2015, 2:17 AM EST
using scalar functions in where condition can cause to run function with every row to check for value we are passing lets say if there are 100 rows then the function will run with every 100 rows.
refer below links for more understanding of it,
http://www.mssqltips.com/sqlservertip/1236/avoid-sql-server-functions-in-the-where-clause-for-performance/
http://blogs.msdn.com/b/sqlserverfaq/archive/2009/10/06/performance-benefits-of-using-expression-over-user-defined-functions.aspx