cancel
Showing results for 
Search instead for 
Did you mean: 

Dez to Hex - from Database to Report

Former Member
0 Kudos

Hello everyone,

i have to do some report regarding our call manager but there is a problem getting the values from the database.

Its this format:

Database        Call Datebase Data         BI Report                       

9,48598145191013E16        94859814519101343        94859814519101300               

9,48598145191013E16        94859814519101253        94859814519101300     

I want to get the Database value into my report but when i do this the field shows me the value from column BI Report. But the correct one would be the value in the middle column. As i could see for example MS Excel also did some rounding at the end.

Then i tried the following formula

Local numberVar dez := database field;Local numberVar quot:= 0;Local numberVar rest:= 0;Local stringVar hex := "";

while (dez > 0)do (quot :=dez \ 16;rest := dez mod 16;dez  := quot;hex  := (iif(rest > 9, ChrW(55+rest), ToText(rest,"#"))) + hex;);hex;

If i try this i get the message that it is too much and cannot be done. I tried to cut the database value with the last 2 digets and then it works all fine. But as i need the full one i wanted to ask the community if someone knows this problem or has an idea for it.

Thank you

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi

Could you please share what you expect in the report and what you are getting from database?

From you post what I understood is that you are getting 9,48598145191013E16 from database and you expect it to display like 9485981451910130000000000000000

Is that correct?

Regards

Niraj

Former Member
0 Kudos

Hi,

in the call manager database i have the value 9,48598145191013E16 and i need the value 94859814519101343 as output. But in Crystal Reports i have the value 94859814519101300.

Is there a way to get the right one as output. As iwrote my formula just works for shorter values.

Former Member
0 Kudos

Hi,

So if you notice that in your database itself 948598145191013E16 it creates exponent after 13 itself so per my knowledge even if we find a way in Crystal we would be multiplying it with the exponential factor itself.

And since your database value does not have 43 after 948598145191013 it will work the same way as you are getting as far as I am concerned.

Let me know if this helps or we can wait if some other experts can advice a better option.

Regards

Niraj

abhilash_kumar
Active Contributor
0 Kudos

Hi Tobias,

What database are you reporting against?

Most databases can store large numbers without converting them to an exp form.

You'd first need to try and fix the number on the database side. Once that is setup, you can use a SQL expression (if youre reporting directly against tables) to convert this number to String.

Converting it to string is the only workaround.

-Abhilash