PSLine2000Documentation/Queries/Q1-14_.md

3.0 KiB

Q1-14_

Analysis generated on: 4/2/2025 10:07:43 AM

SQL Statement

SELECT DISTINCTROW Process.PartName, Process.PartNumber, Process.RevisionLevel, Process.IssueNumber, Process.IssueDate, Process.PreviousIssue, Process.PreviousDate, Process.Programmer, Process.PrintSize, Process.History, Process.MetalType, Process.CutType, Process.PrimeMachine, Process.GrainDir, Process.Deburr, Process.FirstDim, Process.SecDim, Process.PartHeight, Process.BotTrimCut, Process.TopTrimCut, Process.PartWidth, Process.BlankSize, Process.PartSize, Process.GrossWt, Process.ActualWt, Process.Utilization, Process.SheetSize, AddnlProc.ID, AddnlProc.Generated, AddnlProc.OPCode, AddnlProc.Description, AddnlProc.WC1, AddnlProc.WC2, AddnlProc.WC3, AddnlProc.WC4, AddnlProc.Machine, AddnlProc.CycleTime, AddnlProc.RunStd, Process.PartsPerBlank, Process.PartsPerSheet, Process.BlocksPerSheet, Process.BlanksPerBlock, Metals.MetalName, Metals.Gauge, Metals.Density, Process.MaterialCost, Process.LaborCost, Process.PartCost, Process.Reason, Process.CalculationStatus, Metals.Units
FROM (Process INNER JOIN Metals ON Process.MetalType = Metals.PartNo) INNER JOIN AddnlProc ON Process.PartNumber = AddnlProc.PartNumber
WHERE ((Process.PartNumber=[Forms]![14" process sheet]![Partnumber]) AND ((Left([OPCode],1))<>"*" And (Left([OPCode],1))<>"!" And (Left([OPCode],1))<>"@" And (Left([OPCode],1))<>"$"));

Dependencies

Parameters

  • [Forms]![14" process sheet]![Partnumber] (Empty)

What it does

SQL Query Description

This SQL query retrieves a distinct set of data from the Process and AddnlProc tables, joined with the Metals table. The query filters the results based on specific conditions.

Selected Columns

The query selects the following columns:

  • From the Process table:
    • PartName
    • PartNumber
    • RevisionLevel
    • IssueNumber
    • IssueDate
    • PreviousIssue
    • PreviousDate
    • Programmer
    • PrintSize
    • History
    • MetalType
    • CutType
    • PrimeMachine
    • GrainDir
    • Deburr
    • FirstDim
    • SecDim
    • PartHeight
    • BotTrimCut
    • TopTrimCut
    • PartWidth
    • BlankSize
    • PartSize
    • GrossWt
    • ActualWt
    • Utilization
    • SheetSize
  • From the AddnlProc table:
    • ID
    • Generated
    • OPCode
    • Description
    • WC1, WC2, WC3, WC4 (wildcard columns)
    • Machine
    • CycleTime
    • RunStd
  • From the Metals table:
    • MetalName
    • Gauge
    • Density
    • Units

Join Conditions

The query joins three tables:

  1. Process and Metals: On the MetalType column in both tables.
  2. The joined result with AddnlProc: On the PartNumber column.

Filter Conditions

The query applies the following filter conditions to the data:

  • Only rows where PartNumber matches a specific value ("process sheet" with a dynamic part number) are included.
  • Only rows where the first character of the OPCode column is not "*", "!"", "@", or " $" are included.

Final Result

The query returns a distinct set of data that meets the filter conditions, containing the selected columns from the Process, AddnlProc, and Metals tables.