2.6 KiB
2.6 KiB
Filtered Parts RSTD 2
Analysis generated on: 4/2/2025 9:59:56 AM
SQL Statement
SELECT [Filtered Parts rstd].*, AddnlPROC.RunStd
FROM [Filtered Parts rstd] LEFT JOIN AddnlPROC ON ([Filtered Parts rstd].FOPC = AddnlPROC.WC4) AND ([Filtered Parts rstd].FWC3 = AddnlPROC.WC3) AND ([Filtered Parts rstd].FWC2 = AddnlPROC.WC2) AND ([Filtered Parts rstd].PN = AddnlPROC.PartNumber)
WHERE ((([Filtered Parts rstd].Crstd)<>Format([RunStd],"0.00000")))
ORDER BY [Filtered Parts rstd].USAGE DESC;
Dependencies
Parameters
- None
What it does
SQL Query Description
Overview
This SQL query retrieves data from two tables, Filtered Parts rstd
and AddnlPROC
, based on specific conditions and joins them using a LEFT JOIN. The results are filtered to exclude rows where the standardized cost is equal to a specific formatted value.
Breakdown
1. SELECT Clause
SELECT [Filtered Parts rstd].*, AddnlPROC.RunStd
- Selects all columns (
*
) from theFiltered Parts rstd
table and theRunStd
column from theAddnlPROC
table.
2. JOIN Clause
FROM [Filtered Parts rstd] LEFT JOIN AddnlPROC ON (
([Filtered Parts rstd].FOPC = AddnlPROC.WC4) AND
([Filtered Parts rstd].FWC3 = AddnlPROC.WC3) AND
([Filtered Parts rstd].FWC2 = AddnlPROC.WC2) AND
([Filtered Parts rstd].PN = AddnlPROC.PartNumber)
- Performs a LEFT JOIN between the
Filtered Parts rstd
andAddnlPROC
tables. - Joins on four columns:
FOPC
fromFiltered Parts rstd
andWC4
fromAddnlPROC
.FWC3
fromFiltered Parts rstd
andWC3
fromAddnlPROC
.FWC2
fromFiltered Parts rstd
andWC2
fromAddnlPROC
.PN
(Part Number) fromFiltered Parts rstd
andPartNumber
fromAddnlPROC
.
3. WHERE Clause
WHERE ((([Filtered Parts rstd].Crstd)\u003c\u003eFormat([RunStd],"0.00000")))
- Filters out rows where the standardized cost (
Crstd
) in theFiltered Parts rstd
table is equal to a formatted value that represents the same as theRunStd
value from theAddnlPROC
table.
4. ORDER BY Clause
ORDER BY [Filtered Parts rstd].USAGE DESC;
- Orders the results by descending order based on the
USAGE
column in theFiltered Parts rstd
table.
Example Use Case
This query is likely used to retrieve a list of parts with their corresponding standardized costs and additional processing information, excluding rows where the standardized cost matches a specific formatted value. The results can be sorted by usage in descending order to prioritize the most commonly used parts.