Please start any new threads on our new site at 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
Save Password
Forgot your Password?

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 How to Select records even if there is an error?
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Starting Member

6 Posts

Posted - 01/28/2007 :  01:02:58  Show Profile  Send osmansays an AOL message  Click to see osmansays's MSN Messenger address  Send osmansays a Yahoo! Message  Reply with Quote
I have a problem when I try to retrive my data with simple select statment because I am using a convert method with it .My query looks like this :
select userid,username,convert(datetime,joindate,130) from usertable
as you can see I am using "convert" to change from Grigorian data to Hijri date (Arabic date).The convert method raises an error with some values and the select statment will be aborted.

I wonder if there is a way for the select statment to retrive the rest of the data which does't have error on it .just like the try..cath statment ,I need the query to stay working even if there is an error on data by just ignoring the records with error .


In (Som, Ni, Yak)

17689 Posts

Posted - 01/28/2007 :  01:16:47  Show Profile  Reply with Quote

select userid,username,convert(datetime,joindate,130) 
from   usertable 
where  isdate(joindate) = 1


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