Re: Linq Group by whole day

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Marc Gravell

    Re: Linq Group by whole day

    I hadn't yet needed to do this, but I'm kinda glad it works! Shame about
    all those DATEADDs though... I've just run a test, and a

    CAST(FLOOR(CAST (x as float)) as datetime)

    is twice as quick... 2594ms [1310ms] vs 4579ms [2295ms]
    (total-CPU-time [elapsed-time], based on 3773567 rows with a
    non-clustered index on the time column, having pre-fetched the data
    [logical reads], on a multi-core server).

    OK, yes it is a blatant abuse of knowing the data-structure, but should
    be fine for LINQ-to-SQL at least ;-p

    I might drop a message on the LINQ General forum...

    Marc
Working...