I’ve see developers use custom function to remove time from datetime field. It’s obvious that re-usability is preferred by those developers over performance. When we are dealing with millions of records, the custom function will slow down the query dramatically. Instead, I always prefer performance. I use the following code directly in my query.
CONVERT(DATETIME, CONVERT(CHAR(10), B.DT_TM_STAMP, 101)) AS DT
No comments:
Post a Comment