[dba-SQLServer] Date format

Stuart McLachlan stuart at lexacorp.com.pg
Sat Jun 18 21:37:37 CDT 2011


Found it:
http://msdn.microsoft.com/en-us/library/ms180878.aspx#ODBCDatetimeFormat

<quote>
Backward Compatibility for Down-level Clients

Some down-level clients do not support the time, date, datetime2 and datetimeoffset data 
types added in SQL Server 2008. The following table shows the type mapping between an 
up-level instance of SQL Server 2008 and down-level clients.
</quote>

Looks like you are using one of SQL Server 2008's new date/time data types for that field and 
accessing it via ODBC.   MS in their wisdom have decided to convert it and return a 
YY-MM-DD string instead of a numeric value of some type.

Best bet is to change the field type in SQL Server to one of the older datetime or 
smalldatetime types.

-- 
Stuart


On 19 Jun 2011 at 12:28, Stuart McLachlan wrote:

> That rings a bell, I discussed something similar recently on another
> forum, but I can't locate the details now.  It was something about
> ODBC returning a string in that format rather than a DateTime under
> some circumstances.   
> 
> I will keep looking, but in the meantime, can use use CVDate() to
> force it to a real date.
> 
> -- 
> Stuart
> 
> On 18 Jun 2011 at 20:24, jwcolby wrote:
> 
> > I have a table where a field is a date type.  For some reason the
> > date is stored (or at least displayed) in YYYY-MM-DD format.
> > 
> > In my Access FE I am trying to use the date picker from
> > 
> > http://allenbrowne.com/ser-51.html
> > 
> > All the other dates in the system work well with this control (form)
> > but not this one specific date.
> > 
> > The format string placed in the access control does not modify it to
> > be the more (American) normal mm/dd/yyyy.
> > 
> > Does anyone have any ideas why sql server would store / display it
> > in this format?  If I reformat it on the way out to my form, can I
> > store it back in in the more "normal" format and have it store?  	
> > -- John W. Colby www.ColbyConsulting.com
> > _______________________________________________ dba-SQLServer
> > mailing list dba-SQLServer at databaseadvisors.com
> > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver
> > 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