I am trying to get result and display them in a particular format. I’m a beginner and hope below discription is clear.
Table Structure is like mentioned below:
ID| Date | Report| Start time | End Time
REPORT Attribute hold any of the three values(Productivity, Monitoring, Break). I want to display the output in below two formats between two selected dates from a form.
a) DATE | Productivity | Monitoring | break| Start Time | End Time.
The report field has the paramenters productivity, Monitoring and Break. If the value has productivity, then it should display in Productivity column, Monitoring value should be displaed in monitoring field. I’m using PHP and Mysql.
b) DATE | Productivity | Monitoring | break| Start Time | End Time.
Here, I want the optput same a above however,the Start time and End time should display the sum of time between the selected dates.
Mysql SELECT help for a beginner
Moderator: General Moderators
-
naveendk.55
- Forum Newbie
- Posts: 24
- Joined: Tue Aug 16, 2011 10:13 am
Re: Mysql SELECT help for a beginner
Code: Select all
SELECT
DATE,
if( Report = 'Productivity', Report, null) as Productivity,
if( Report = 'Monitoring', Report, null) as Monitoring,
if( Report = 'break', Report, null) as break,
Start Time,
End Time
FROM ....