sql - Update birthdate incase the date is Hijri by the value of converting hijri birthdate to Gregorian -


table contains many records hijri date value , gregorian value in birthdate column, please how update birthdate value of converting hijri date gregorian tried script dosen't work - meant no changes - although

(18422 row(s) affected)

update member set birthdate = case when (substring(cast(birthdate nvarchar), 1, 2) ='14')  or  (substring(cast(birthdate nvarchar), 1, 2) ='13')  (select convert(date, birthdate , 131) )  else  birthdate  end 

try below code convert birthdate column records hijri format:

update member set birthdate = convert(varchar(100),birthdate,131) --- [hijri date gregorian date]

update member set birthdate = convert(datetime, birthdate, 131) --- [ gregorian date hijri date]

there several blogs this, likethis one: http://blogs.msdn.com/b/wael/archive/2007/04/29/sql-server-hijri-hijra-dates.aspx


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -