Welcome, Guest. Please Login.
05/02/24 at 15:19:16
News:
Home Help Search Login


Pages: 1
Send Topic Print
CR to Break out Material and Labor Cost by Class (Read 2159 times)
vswhipple
Browser
*




Posts: 28
CR to Break out Material and Labor Cost by Class
09/23/08 at 15:24:13
 
I'd like to be able to create a CR that separates out the material cost and labor cost on work orders by product class.  First question.... is it doable?  Second question... what files do I need to link up?
 
I'm a DBA Classic user.
 
Thanks for any insights!
Vykie Whipple
Brey-Krause Mfg. Co.
Back to top
 
 
WWW   IP Logged
Kelloggs
Active Member
*****


Do crazy people know
they are crazy?

Posts: 785
Gender: male
Re: CR to Break out Material and Labor Cost by Cla
Reply #1 - 09/24/08 at 08:01:05
 
You need two tables: BKICMSTR and WORKORD
 
I dont use CR, but this query works on Pervasive Control Center:
 
SELECT  
BKICMSTR.BKIC_PROD_CLASS,  
Sum(WORKORD.MTWO_WIP_AMAT) AS AMAT,  
Sum(WORKORD.MTWO_WIP_AOUTPR) AS AOUTPR,  
Sum(WORKORD.MTWO_WIP_ALABOR) AS ALABOR
FROM WORKORD INNER JOIN BKICMSTR ON WORKORD.MTWO_WIP_CODE = BKICMSTR.BKIC_PROD_CODE
WHERE WORKORD.MTWO_WIP_STATUS = 'R'
GROUP BY BKICMSTR.BKIC_PROD_CLASS
 
 
 Tongue
 
Kelloggs
Back to top
 
 

Evo ERP - 35 Users
Dumped MS Access like a hot potato (VB.Net rules!!!)
Email WWW   IP Logged
vswhipple
Browser
*




Posts: 28
Re: CR to Break out Material and Labor Cost by Cla
Reply #2 - 09/24/08 at 09:36:07
 
Thanks so much for the feedback!  The query worked perfectly; however, after I ran it I realized I did a poor job of describing the criteria.  I'm hoping to be able to break out material and labor costs on closed work orders by item class for the year 2006.  I'd like to compare these totals with the current year.  I believe the query you created was for open work orders, right?
Back to top
 
 
WWW   IP Logged
Kelloggs
Active Member
*****


Do crazy people know
they are crazy?

Posts: 785
Gender: male
Re: CR to Break out Material and Labor Cost by Cla
Reply #3 - 09/24/08 at 09:45:42
 
SELECT  
BKICMSTR.BKIC_PROD_CLASS,  
Sum(WORKORD.MTWO_WIP_AMAT) AS AMAT,  
Sum(WORKORD.MTWO_WIP_AOUTPR) AS AOUTPR,  
Sum(WORKORD.MTWO_WIP_ALABOR) AS ALABOR  
FROM WORKORD INNER JOIN BKICMSTR ON WORKORD.MTWO_WIP_CODE = BKICMSTR.BKIC_PROD_CODE  
WHERE WORKORD.MTWO_WIP_STATUS = 'C'  
AND WORKORD.MTWO_WIP_AFIN >= '2006-01-01' AND WORKORD.MTWO_WIP_AFIN <= '2006-12-31'
GROUP BY BKICMSTR.BKIC_PROD_CLASS
 
Note:
I am using the Actual Finish Date
and if you have archived WO you need to run another query using the WORKHORD table
 
 Tongue
 
Back to top
 
 

Evo ERP - 35 Users
Dumped MS Access like a hot potato (VB.Net rules!!!)
Email WWW   IP Logged
vswhipple
Browser
*




Posts: 28
Re: CR to Break out Material and Labor Cost by Cla
Reply #4 - 09/24/08 at 10:03:38
 
Perfect!!  Thanks so much! Smiley  Where can I learn to write queries like that??
Back to top
 
 
WWW   IP Logged
GasGiant
Administrator
*****


How can I help?

Posts: 1523
Gender: male
Re: CR to Break out Material and Labor Cost by Cla
Reply #5 - 09/24/08 at 10:38:03
 
I recommend Learning SQL by Alan Beaulieu,  from O'Reilly Media, Inc.
Back to top
 
 


Email WWW GasGiant GasGiant 31012781 swordworlder swordworlder   IP Logged
Kelloggs
Active Member
*****


Do crazy people know
they are crazy?

Posts: 785
Gender: male
Re: CR to Break out Material and Labor Cost by Cla
Reply #6 - 09/24/08 at 11:08:13
 
SQL for beginners
 
http://www.w3schools.com/sql/default.asp
 
and DBA file names, Field Names and field descriptions to be used for developing Crystal Reports and custom programs using DBA data
 
http://www.istechsupport.com/freedl.php
 
Cheesy
Back to top
 
 

Evo ERP - 35 Users
Dumped MS Access like a hot potato (VB.Net rules!!!)
Email WWW   IP Logged
vswhipple
Browser
*




Posts: 28
Re: CR to Break out Material and Labor Cost by Cla
Reply #7 - 09/24/08 at 11:12:23
 
Thanks for the great information!!
Back to top
 
 
WWW   IP Logged
Pages: 1
Send Topic Print