Thursday, October 4, 2007

SQL Server: conversion from char to date error

Q: I have a query INSERT INTO ...SELECT FROM ...
were in select statement I have this sintax: convert(varchar(10),ColName,103)
for convert date type "DD/MM/YYYY HH.MM.SS" to format: "DD/MM/YYYY"
when try to execute in QueryAnalyzer, it show this error:
The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value.
The statement has been terminated.

A: SET DATEFORMAT DMY

No comments: