Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Converting numbers to text 1

Status
Not open for further replies.

Pyskow

Technical User
Oct 18, 2006
10
0
0
DK
Here we go again.

I need to make a report for Incidents in HP ServiceDesk, that shows me all incidents on a weekly basis, also showing priority.

The table that has the priority, holds a number code like this:

3,094,610,072.000
3,094,610,073.000
3,094,610,074.000
3,094,610,075.000
3,094,610,076.000

The number that identifies the priority is 072, 073 ect. and where
072 = None
073 = Low
074 = Medium
075 = High
076 = Critcal

I have tried the following code:

If {ITSM_INCIDENTS.INC_CIT_OID} = (072) then "None" or
If {ITSM_INCIDENTS.INC_CIT_OID} = (073) then "Low" or
If {ITSM_INCIDENTS.INC_CIT_OID} = (074) then "Medium" or
If {ITSM_INCIDENTS.INC_CIT_OID} = (075) then "High" or
If {ITSM_INCIDENTS.INC_CIT_OID} = (076) then "Critical"

But in the 4th line (High) it highlights "high" and reports back that a boolean is reqiuired here.

Any good idears?





Bo Pyskow
Crystal Reports Newbie
 
If you are extracting the code from the number, you would need to do something like:

select val(right(totext({ITSM_INCIDENTS.INC_CIT_OID},0,""),3))
case 72 : "None"
case 73 : "Low"
case 74 : "Medium"
case 75 : "High"
case 76 : "Critical"

This doesn't address your error message. Your "or's" should all be replaced with "else".

-LB
 
Thanks again :) Once again u did it.


Bo Pyskow
Crystal Reports Newbie
 
or:

select ({ITSM_INCIDENTS.INC_CIT_OID}mod 100)
case 72 : "None"
case 73 : "Low"
case 74 : "Medium"
case 75 : "High"
case 76 : "Critical"
 
Case is the neatest way to do it, but the original code should have worked if you'd put
Code:
If {ITSM_INCIDENTS.INC_CIT_OID} = (072) then "None" [b]else[/b]
If {ITSM_INCIDENTS.INC_CIT_OID} = (073) then "Low" [b]else[/b]
etc.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top