Convert SQL server datetime fields to compare date parts only, with indexed lookups

前端 未结 5 768
野性不改
野性不改 2020-11-30 00:23

I\'ve been doing a convert(varchar,datefield,112) on each date field that I\'m using in \'between\' queries in SQL server to ensure that I\'m only accounting fo

5条回答
  •  天命终不由人
    2020-11-30 00:42

    Have a computed persisted column calculate the expression you need. If columns are computed and persisted, they can also be indexed.

提交回复
热议问题