2.4 KiB
2.4 KiB
DedicatedCellQ
Analysis generated on: 4/2/2025 9:59:08 AM
SQL Statement
SELECT ProductMaster.PRDNO, DedicatedCells.Active, DedicatedCells.AlphaCode, DedicatedCells.Machine
FROM ProductMaster INNER JOIN DedicatedCells ON ProductMaster.PALPH = DedicatedCells.AlphaCode
WHERE (((ProductMaster.PRDNO)=Left([Forms]![Process Sheet]![PartNumber],7)) AND ((DedicatedCells.Active)=True));
Dependencies
Parameters
- [Forms]![Process Sheet]![PartNumber] (Empty)
What it does
SQL Query Description
This SQL query retrieves data from two tables, ProductMaster
and DedicatedCells
, based on specific conditions. The query is designed to find the dedicated cells for a given part number.
Query Components
- Inner Join: The query performs an inner join between the
ProductMaster
table and theDedicatedCells
table on thePALPH
column inProductMaster
and theAlphaCode
column inDedicatedCells
. - Filter Conditions:
ProductMaster.PRDNO = Left([Forms]![Process Sheet]![PartNumber], 7)
: This condition filters the results to include only rows where the part number (PRDNO
) matches the first seven characters of the value in thePartNumber
field on a form called "Process Sheet".DedicatedCells.Active = True
: This condition further filters the results to include only active cells.
- Selected Columns:
- The query selects columns from both tables:
PRDNO
,Active
,AlphaCode
, andMachine
.
- The query selects columns from both tables:
Query Functionality
This SQL query is designed to:
- Find dedicated cells for a specific part number based on the first seven characters of the part number.
- Filter the results to only include active cells.
Example Use Case
This query can be used in an inventory management system to display information about dedicated cells for a particular product.
Query Breakdown
- Table Names and Columns:
ProductMaster
,PRDNO
;DedicatedCells
,Active
,AlphaCode
,Machine
. - Join Condition:
PALPH = AlphaCode
. - Filter Conditions:
- Part number matching.
- Active cells only.
- Selected Columns:
PRDNO
,Active
,AlphaCode
,Machine
.
Formulas Used
Left([Forms]![Process Sheet]![PartNumber], 7)
to extract the first seven characters of the part number.