473,382 Members | 1,202 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

sql query out of range datetime value

11
create proc getproviders
as
begin
select ProviderType,ProviderTypeId,ProviderName,City,Stat e,Country,
StagingName,providerCode,convert(varchar(10),Agree ment_enddate,101)Agreement_enddate from provider
join stagingMaster on
stagingMaster.StagingId = provider.StagingId
where isDate(Agreement_enddate) = 1 and convert(datetime,Agreement_enddate,101) <= getdate() and logicallyDeletedFlag=0
end

iam getting the following error can any one suggest

Msg 242, Level 16, State 3, Procedure GetExpiredProviders, Line 4
The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value.

thanks & regards
raam
Sep 9 '08 #1
2 4454
code green
1,726 Expert 1GB
Not sure where the error is but I think it is this line
Expand|Select|Wrap|Line Numbers
  1. convert(datetime,Agreement_enddate,101)
Test by removing that line.
I can't see why you are converting to a datetime.
Surely it already exists as such.
To remove any ambiguity rename the alias 'Agreement_enddate' to something else.
Sep 9 '08 #2
ck9663
2,878 Expert 2GB
What's the data type of this column: Agreement_enddate

-- CK
Sep 9 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Maksim Kasimov | last post by:
there are few of a time periods, for example: 2005-06-08 12:30 -> 2005-06-10 15:30, 2005-06-12 12:30 -> 2005-06-14 15:30 and there is some date and time value: 2005-06-11 12:30 what is the...
4
by: Russell | last post by:
I'm having a fit with a query for a range of dates. The dates are being returned from a view. The table/field that they are being selected from stores them as varchar and that same field also...
3
by: Philip Yale | last post by:
A colleague of mine has a query which fails to run under SQLAgent batch with the following error: The conversion of a char data type to a datetime data type resulted in an out-of-range datetime...
11
by: Dennis D. | last post by:
VB.net does not seem to have adequate structure for handling time within it's own code. Subtract 15 minutes from 00:00 AM, and an out of range condition results. Subtract 15 minutes from 12:00 PM,...
7
by: serge | last post by:
How can I run a single SP by asking multiple sales question either by using the logical operator AND for all the questions; or using the logical operator OR for all the questions. So it's always...
0
by: Jim in Arizona | last post by:
I built a ticket system a while back but I never could get the queries quite right. My queries work as long as I don't use a date range. Here is the code I use for the query portion (the relevant...
2
by: sixdeuce62 | last post by:
Hello, I am trying to create a query that will prompt me to enter the parameter value if beginning date and ending date. I have created everything I need in the query, but I have to manually go...
3
by: Dinesh | last post by:
Hi Experts, I am working on SSRS 2005, and I am facing a problem in counting the no of days. My database has many fields but here I am using only two fields They are Placement_Date and...
14
by: Simon Gare | last post by:
Hi, have a search.asp page with results.asp page drawing data from an SQL db, problem is the user has to type the whole field value into the search box to retrieve the value on results.asp, what...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.