[dba-SQLServer] RE: [AccessD] Date syntax in SQL Server

jwcolby jwcolby at colbyconsulting.com
Sun Jun 13 14:36:30 CDT 2004


I didn't do the convert, SQL Server threw that in and I was trying to get
rid of it.

John W. Colby 
www.ColbyConsulting.com

-----Original Message-----
From: dba-sqlserver-bounces at databaseadvisors.com
[mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Francis
Harvey
Sent: Sunday, June 13, 2004 1:46 PM
To: SQLServer
Subject: [dba-SQLServer] RE: [AccessD] Date syntax in SQL Server


Why bother doing any conversion at all? You already have an
internationalized date value and I would assume your DateOfBirth field is a
datetime field. Conversion would be automatic, so just use:

WHERE     (DateOfBirth >= '1970-01-01')

Francis R Harvey III
WB 303, (301)294-3952
harveyf1 at westat.com


> -----Original Message-----
> From: accessd-bounces at databaseadvisors.com
> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby
> Sent: Saturday, June 12, 2004 11:46 PM
> To: 'Access Developers discussion and problem solving'; SQLServer
> Subject: [AccessD] Date syntax in SQL Server
> 
> 
> What is the syntax for dates in SQL Server?
> 
> WHERE     (DateOfBirth >= CONVERT(DATETIME, '1970-01-01', 102))
> 
> I need to get rid of the convert.  Bracketing in ## doesn't work.
> 
> John W. Colby
> www.ColbyConsulting.com
> 
> 
> --
> _______________________________________________
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
> 
_______________________________________________
dba-SQLServer mailing list
dba-SQLServer at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/dba-sqlserver
http://www.databaseadvisors.com







More information about the dba-SQLServer mailing list