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

Francis Harvey HARVEYF1 at WESTAT.com
Sun Jun 13 12:46:05 CDT 2004


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
> 



More information about the dba-SQLServer mailing list