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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create a custom report...

Status
Not open for further replies.

drikoudis

Programmer
Nov 1, 2003
53
0
0
GR
Hello, my new problem is: I have a table with some fields like ID, Name, Health_State, bla bla bla. The Health_State field taking values(-1, 0) from a CheckBox. Now i want to make a report with all this fields but my problem is, if the value in the Health_State is -1 the report must say Dead and if is 0
then i want to write Alive. I dont know how to do this. If anyone have any ideas please tell them.

Thanks and of course sorry for my English.

John.
 
That may require a procedure with and If clause. If i understand what your asking.

this is a good example:
CREATE PROCEDURE UPDATE_SALARY_IF
(IN employee_number CHAR(6), INOUT rating SMALLINT)
LANGUAGE SQL
BEGIN
DECLARE not_found CONDITION FOR SQLSTATE '02000';
DECLARE EXIT HANDLER FOR not_found
SET rating = -1;
IF rating = 1
THEN UPDATE employee
SET salary = salary * 1.10, bonus = 1000
WHERE empno = employee_number;
ELSEIF rating = 2
THEN UPDATE employee
SET salary = salary * 1.05, bonus = 500
WHERE empno = employee_number;
ELSE UPDATE employee
SET salary = salary * 1.03, bonus = 0
WHERE empno = employee_number;
END IF;
END
 
Hi Tommyhat, i understand this example but isn't useful. If in the field Helth_State is -1 then i want in the report write "Dead" not -1 also with value 0 i want to write "Alive" not the number 0.

Thanks, John
 
I ran into a similar problem. Try placing a textbox in the the Detail section of the report and setting the Control source property to: =IIf([Health_State]=-1,"Dead","Alive")
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top