Please start any new threads on our new site at http://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Conversion failed when converting date and/or time
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Kapland
Starting Member

USA
5 Posts

Posted - 07/29/2013 :  13:31:16  Show Profile  Reply with Quote
I have some code that runs exactly as I want it to, however when I change the date from 'December 2012' to 'May 13' (This is exactly how it is stored in the data) I get this error message:
Msg 241, Level 16, State 1, Line 1
Conversion failed when converting date and/or time from character string.
Warning: Null value is eliminated by an aggregate or other SET operation.

The code runs without any issues for December data. Any ideas?

tkizer
Almighty SQL Goddess

USA
38200 Posts

Posted - 07/29/2013 :  14:17:09  Show Profile  Visit tkizer's Homepage  Reply with Quote
Show us the code and point out which column it is.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52326 Posts

Posted - 07/30/2013 :  02:46:09  Show Profile  Reply with Quote
this reason may be related to dateformat seeting/ language regional setting of the server.

Try to pass date values in unambiguos format like YYYYMMDD

http://visakhm.blogspot.in/2011/12/why-iso-format-is-recommended-while.html


------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page

kameswararao polireddy
Starting Member

India
19 Posts

Posted - 08/28/2013 :  11:11:12  Show Profile  Reply with Quote
You can find different types of date formats in the below link.


http://www.sql-server-helper.com/tips/date-formats.aspx

P.Kameswara rao
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.82 seconds. Powered By: Snitz Forums 2000