sql server - SQL Returning todays data only -


i need return data (todays) table. i'm using query job not fast like.

current query

where (calldetail.dnis='456456') , calldetail.connecteddatetimegmt > cast(floor(cast(getdate() float))as datetime) 

another query use returns past weeks worth of data in matter of seconds.

where (calldetail.localname='name') , (calldetail.connecteddate between dateadd(wk,-1,getdate()) , getdate()) 

is there more effective query can use return data today?

instead of casting 2 times return date part getdate() slows down query

where (calldetail.dnis='456456')  , calldetail.connecteddatetimegmt > cast(floor(cast(getdate() float))as datetime) 

use faster way return date part getdate()

where (calldetail.dnis='456456') , calldetail.connecteddatetimegmt > dateadd(dd, 0, datediff(dd, 0, getdate())) 

Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -