79598488

Date: 2025-04-29 13:39:59
Score: 1
Natty:
Report link

what makes it efficient? Indexes

so all you need to do is to let them be indexable..

which means you cant use any wrapper function around your date and datetime fields(like converting them to string or integer)

there are some harmless exceptions like DateAdd(). while seeking range its still range..

so using

DateTime >= Date AND DateTime < DATEADD(DAY, 1, Date)

is fine..

and i d never use anything like;

WHERE CAST(DateTimeColumn AS DATE) = DateColumn

Reasons:
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Starts with a question (0.5): what
  • Low reputation (0.5):
Posted by: Serkan Ekşioğlu