Link to home
Start Free TrialLog in
Avatar of Syed Shareef Ahmed
Syed Shareef AhmedFlag for Saudi Arabia

asked on

How to conver to Hijri date in SSRS

Could any one help me to convert Goergoin Data to Hijri date given in parameter in SSRS. The parameter is integer type where date is converted as =CInt(Format(DateAdd("d",-1,today()), "yyyyMMdd")) the default value.

in design view i am inserting a text box and writing an express IIf(Parameters!TDATE.Value >0 ,FORMAT(CDate(Mid(Parameters!TDATE.Value,5,2) + "-" + Right(Parameters!TDATE.Value,2) + "-" + Left(Parameters!TDATE.Value,4)),"dd-MM-yyyy"),"").

I am also require to convert the date in Hijri date in an other text box.

my back end database is DB2i on iSeries.
ASKER CERTIFIED SOLUTION
Avatar of Arifhusen Ansari
Arifhusen Ansari
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Syed Shareef Ahmed

ASKER

Hi

Dear Arif,

Thanks a lot for the solution and sample rdl.

In my report I am not getting 'Hijri' option in the drop down list???

But I can see the 'Hijri' option in the sample rdl you send.

I am attaching a screen shot for you easy reference.
Hijri-Date.JPG
I think you are using report builder. I did have created report in sql server data tools.
Can you please try to open your rdl file in SSDT or Visual Studio and verify whether you have that option or not.
Yes, i got it in report builder itself, after selecting 'Language' to 'sr=SA' then 'Calender' . But the text expression i am using is not converting it to Hijri date, my expression is as below.

IIf(Parameters!TDATE.Value >0 ,FORMAT(CDate(Mid(Parameters!TDATE.Value,5,2) + "-" + Right(Parameters!TDATE.Value,2) + "-" + Left(Parameters!TDATE.Value,4)),"dd-MM-yyyy"),"")
Covert into date after format.
Using CDate
Thanks for prompt and accurate responses.