[dba-SQLServer] SQL Server date functions

Robert L. Stewart robert at webedb.com
Tue Mar 18 13:20:27 CDT 2008


date between '1/1/2008 00:00:00' and '1/2/2008 00:00:00'

It is best to strip the time off when doing what you are doing.
Check the CONVERT function.

Robert

At 01:00 PM 3/18/2008, you wrote:
>Date: Tue, 18 Mar 2008 13:50:17 -0400
>From: "jwcolby" <jwcolby at colbyconsulting.com>
>Subject: [dba-SQLServer] SQL Server date functions
>To: "'Discussion concerning MS SQL Server'"
>         <dba-sqlserver at databaseadvisors.com>
>Message-ID: <004f01c88920$876cc370$0201a8c0 at M90>
>Content-Type: text/plain;       charset="us-ascii"
>
>I am pulling a TopN kind of thing and marking those records with GetDate()
>which places a date and time in a date field.  Now I want to pull all the
>records with today's date.  The first problem is that GetDate() pulls the
>date and time.  The second problem is what to place in the filter.  I am not
>finding a date() kind of thing like you have with Access.
>
>How do I pull all records with today's date in a date field (that also
>contains the time)?
>
>John W. Colby
>Colby Consulting
>www.ColbyConsulting.com
>
>
>
>------------------------------
>
>_______________________________________________
>dba-SQLServer mailing list
>dba-SQLServer at databaseadvisors.com
>http://databaseadvisors.com/mailman/listinfo/dba-sqlserver
>
>
>End of dba-SQLServer Digest, Vol 61, Issue 10
>*********************************************





More information about the dba-SQLServer mailing list