hijri calender with sql server 2005
-
im working on windows applicaction and i want to support th ehijri calnder (islamic calnder) the year 1428 will be 2007. but when im trying to inser new filed gave me out of range (1765<) here is some examples:- declare @x datetime set @x= convert(datetime ,'01/01/1428',131) print @x the result is ===> "Jan 19 2007 12:00AM" convert from hijri to gregorian worked well but declare @x datetime set @x= convert(datetime ,'01/01/1482',101) print @x the result is ===> "The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value. " tha means cant convert from hijri to gregorian so plz what is the best method for me to accept the both pc calender setting for my application. regards
-
im working on windows applicaction and i want to support th ehijri calnder (islamic calnder) the year 1428 will be 2007. but when im trying to inser new filed gave me out of range (1765<) here is some examples:- declare @x datetime set @x= convert(datetime ,'01/01/1428',131) print @x the result is ===> "Jan 19 2007 12:00AM" convert from hijri to gregorian worked well but declare @x datetime set @x= convert(datetime ,'01/01/1482',101) print @x the result is ===> "The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value. " tha means cant convert from hijri to gregorian so plz what is the best method for me to accept the both pc calender setting for my application. regards
Here is a clue. Try both of these queries:
declare @x datetime set @x= convert(datetime ,'01/01/1428',131) print @x print convert(datetime ,'01/19/2007',101)
Regards GuyYou always pass failure on the way to success.