dbTalk Databases Forums  

SQL query filtering date field by today's date?

comp.databases.ms-sqlserver comp.databases.ms-sqlserver


Discuss SQL query filtering date field by today's date? in the comp.databases.ms-sqlserver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Igor
 
Posts: n/a

Default SQL query filtering date field by today's date? - 11-03-2006 , 04:27 AM






Can someone tell me sql query for filtering date field for current day,
not last 24hours but from 00:00 to current time?


Reply With Quote
  #2  
Old   
markc600@hotmail.com
 
Posts: n/a

Default Re: SQL query filtering date field by today's date? - 11-03-2006 , 06:22 AM






select *
from mytable
where datediff(day,getdate(),col)=0 and col <= getdate()


Reply With Quote
  #3  
Old   
Igor
 
Posts: n/a

Default Re: SQL query filtering date field by today's date? - 11-08-2006 , 04:48 AM




markc600 (AT) hotmail (DOT) com wrote:
Quote:
select *
from mytable
where datediff(day,getdate(),col)=0 and col <= getdate()
I forgot that i posted this , thanks for your reply.



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.