Tech
Forums
Jobs
Books
Events
Live
Interviews
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
1
Reply
Error : Conversion failed converting date and/or time
Nepethya Rana
Jul 12 2017 11:13 AM
160
Reply
I have a table with InsertedDate column which data type is 'Date'.
This column has today's date stored as '2017-07-12'.
Now I am trying to count the from this table based on today's date,
my query is :
SELECT Count(ProductSold) from ProductSalesDetail WHERE(DATEPART(yy, 'InsertedDate') = 2017 AND DATEPART(mm, 'InsertedDate') = 07 AND DATEPART(dd, 'InsertedDate') = 12)
It throws error : Conversion failed when converting date and/or time from character string.
how do i perform this operation ?
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
1
)
Next Recommended Forum
insert and update query
mutual friends query