If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > assigning variables

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-11-08, 05:59
homer.favenir homer.favenir is offline
Registered User
 
Join Date: Oct 2007
Location: Manila, Philippines
Posts: 132
assigning variables

hi to all,
how can i assign variables in a regex?
e.g.
Code:
sum(coding_log.break_hours) as 'total break',
and use it to another regex.
thanks
__________________
Take Nothing But Pictures;
Leave Nothing But Footprints;
Kill Nothing But Time;
Reply With Quote
  #2 (permalink)  
Old 06-13-08, 06:01
homer.favenir homer.favenir is offline
Registered User
 
Join Date: Oct 2007
Location: Manila, Philippines
Posts: 132
Code:
SUM(CASE WHEN coding_log.time_end > '16:00' THEN coding_log.break_hours ELSE 0 END) as 'Total OT Break',

-- total ot idle work related
format(time_to_sec(SUM(CASE WHEN coding_log.time_end > '16:00' && coding_log.adjustment = 'Idle (work related)'
        THEN coding_log.adjustment_time ELSE 0 END))/3600,2)
        as 'Total OT Idle (work related)',

-- total ot idle personal
format(time_to_sec(SUM(CASE WHEN coding_log.time_end > '16:00' && coding_log.adjustment = 'Idle (personal)'
        THEN coding_log.adjustment_time ELSE 0 END))/3600,2)
        as 'Total OT Idle (personal)',

-- total ot meeting
format(time_to_sec(SUM(CASE WHEN coding_log.time_end > '16:00' && coding_log.adjustment = 'meeting'
        THEN coding_log.adjustment_time ELSE 0 END))/3600,2)
        as 'Total OT Meeting',

-- total ot orientation
format(time_to_sec(SUM(CASE WHEN coding_log.time_end > '16:00' && coding_log.adjustment = 'orientation'
        THEN coding_log.adjustment_time ELSE 0 END))/3600,2)
        as 'Total OT Orientation',
i like to add 'Total OT Break', 'Total OT Idle (work related)', 'Total OT Idle (personal)'.

any advice, please.

thanks
__________________
Take Nothing But Pictures;
Leave Nothing But Footprints;
Kill Nothing But Time;
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On