CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 Summing up fields and a label

Print topic Send  topic

Author Message
ijtzib

Posts: 24
Posted: 07/29/2012, 9:37 PM

Hi guys...

Maybe someone can help in this one...It must be easy but I need a direction on how to accomplish this...

I have a table and two fields in dbase...

TABLE: vacationleave
FIELD: Employee_ID
FIELD: Employee_Name
FIELD: Earned_Input
FIELD: Lost_Input
and a calculated value in a label Total_Vacation_Leave in a form frm_vacationleave based on the table.

So what I want to accomplish is Available_Leave for each employee...
Which suppose to be:

the sum of Earned_Input - the sum of Lost_Input - Total_Vacation_Leave = ??Available_Leave??

Hope this is clear...

Thanks
Ijtzib
View profile  Send private message
mamboBROWN


Posts: 1713
Posted: 08/24/2012, 6:15 AM

ijtzib,

Where you able to figure this out or do you still need assistance?
View profile  Send private message
Lucius

Posts: 220
Posted: 08/24/2012, 3:14 PM

ijtzib, I would go with the event for control that should display the value (like BeforeShow), the query the 2 values you have in the DB (Earned_Input & Lost_Input ), get the last value you need for calculation (Total_Vacation_Leave from the calculation label). Afterwards it is a simple thing to calculate and display...

If you can't get the Total_Vacation_Leave value for some reason at the event you wish to display in, I would suggest to store the Total_Vacation_Leave value in session for the user or use a separate DB table which is recalculated every once in a while.
View profile  Send private message
ijtzib

Posts: 24
Posted: 09/03/2012, 1:38 PM

ok guys...

sorry about the late reply to this topic... had other delays...

Actually I restructured the tables here...and hence the question will change in regards to tables...I will rewrite the question and submit ASAP....

Thanks.....

ijtzib
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.