Better Filtering With YEAR and MONTH Functions In SQL Server

Поделиться
HTML-код
  • Опубликовано: 11 дек 2024

Комментарии • 9

  • @amsa3911
    @amsa3911 18 часов назад

    Can't you just have computed column on year + month and put a index on it?

  • @finbarlay4948
    @finbarlay4948 2 часа назад

    Last week I had to do something very similar where a comparison date was being stripped to 7 characters that I hadn't realised. I used the following to calculate the from and too dates :-
    DATEADD(MONTH, DATEDIFF(MONTH, 0, @DateCheck), 0) -- First of Month
    DATEADD(MONTH, 1 + DATEDIFF(MONTH, 0, @DateCheck), -1) -- End of Month

  • @FlaggedStar
    @FlaggedStar 18 часов назад +1

    Weird video. It has two comments, but I can see neither.