CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 value greater than 60 should be coverted t 60

Print topic Send  topic

Author Message
itzumar

Posts: 78
Posted: 03/03/2014, 11:47 AM

Dear!

I have data base of employee. I want that if sum of value exceed greater than 60 , than it should be converted into 60.

I am using mysql and php? how can u do it? plz help me
_________________
Umar
View profile  Send private message
eratech


Posts: 513
Posted: 03/03/2014, 3:33 PM

Umar - please see my previous answer about the SQL CASE statement - it is really an IF..THEN statement in SQL.

You can then check if the sum is > 60 and return 60 instead.

Or in the 'Before Show' event for whatever you are showing the data, do the check there.

E
_________________
CCS 3/4/5 ASP Classic, VB.NET, PHP
Melbourne, Victoria, Australia
View profile  Send private message
itzumar

Posts: 78
Posted: 03/04/2014, 12:19 AM

Dear ratech!

can u explain with example???????????? will be very thankful to you
_________________
Umar
View profile  Send private message
eratech


Posts: 513
Posted: 03/04/2014, 4:51 PM

Umar - you will learn more by trying out the CASE example.

You can put something like
(case when (sum(hours) > 60) then 60 else sum(hours) end) as totallimit
into your SQL and trying it out.

I suggest you look into some of the things that SQL can do as it is really powerful and often overlooked when programming in 'higher' languages.

Eric
_________________
CCS 3/4/5 ASP Classic, VB.NET, PHP
Melbourne, Victoria, Australia
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.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


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