Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 calculating cost of parts

Author  Topic 

Kc_guy
Starting Member

1 Post

Posted - 2010-05-20 : 10:41:38
Hello everyone,

I am attempting to do some cost analyzing the problem im running into is that when its calculating parts cost our revision of parts goes from -a to -z and after that it does go to -aa but when the script is running it sees the -z as cost more than -aa. Hope that someone can help me out. If needed email me and i can try and explain further. Here is the code that we are using to run the script.


SELECT Job.Job, Job.Part_Number, Job.Act_Total_Hrs, Job.Act_Labor, Job.Act_Material, Job.Act_Service, Job.Act_Labor_Burden, Job.Act_Machine_Burden,
Job.Act_GA_Burden, SUM(Job_Operation_Time.Act_Run_Hrs) AS ActMachineRunHrs, SUM(Job_Operation_Time.Act_Setup_Hrs)
AS ActMachineSetupHrs, SUM(Job_Operation_Time.Act_Run_Labor_Hrs) AS ActLaborRunHrs, SUM(Job_Operation_Time.Act_Setup_Labor_Hrs)
AS ActLaborSetupHrs
FROM Job INNER JOIN
Job_Operation ON Job.Job = Job_Operation.Job INNER JOIN
Job_Operation_Time ON Job_Operation.Job_Operation = Job_Operation_Time.Job_Operation
GROUP BY Job.Job, Job.Part_Number, Job.Act_Total_Hrs, Job.Act_Labor, Job.Act_Material, Job.Act_Service, Job.Act_Labor_Burden, Job.Act_Machine_Burden,
Job.Act_GA_Burden
HAVING (Job.Job IN
(SELECT MAX(Job) AS MostRecentJob
FROM Job
WHERE (FG_Transfer_Qty > 0)
GROUP BY Part_Number
HAVING (Part_Number IN
(SELECT PartNumber
FROM JBTools.dbo.CLR20100510)))) AND (Job.Job NOT LIKE '%RW%') AND (Job.Job NOT LIKE '%NRE%')
ORDER BY Job.Part_Number


Thank you in advance

Dan

AndrewMurphy
Master Smack Fu Yak Hacker

2916 Posts

Posted - 2010-05-21 : 04:15:41
have a look at our FAQ section re "how to help us help you"...especialyl re probvinding sample input data, sample (matching) expected results and sampl table structures.
Go to Top of Page
   

- Advertisement -