[dba-SQLServer] SQL Server date functions

Paul Nielsen pauln at sqlserverbible.com
Tue Mar 18 14:19:45 CDT 2008


Now that I think about it I did a study a couple years ago of the fastest
possible way to extract the date from datetime. This is what I found at the
time (no pun in 10 did)

SELECT Convert(CHAR(10), CURRENT_TIMESTAMP, 101 )






-----Original Message-----
From: dba-sqlserver-bounces at databaseadvisors.com
[mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby
Sent: Tuesday, March 18, 2008 11:50 AM
To: 'Discussion concerning MS SQL Server'
Subject: [dba-SQLServer] SQL Server date functions

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
http://www.databaseadvisors.com


__________ NOD32 2957 (20080318) Information __________

This message was checked by NOD32 antivirus system.
http://www.eset.com





More information about the dba-SQLServer mailing list