Selecting details of Optional Items from QuoteWerks database

The below T-SQL statement provides a template for selecting details of Optional Items from the QuoteWerks SQL Server database. If you have any questions or if you’d like an equivalent for an Access backend, then please email development@hilltopsit.co.uk.

SELECT OH.SetName AS PrimaryProductCode, PP.[Description] AS PrimaryProductDescription
    , OI.PartNumber AS OptionalProductCode, PO.[Description] AS OptionalProductDescription
FROM QuoteWerks.dbo.OptionsHeaders AS OH WITH (NOLOCK)
    INNER JOIN QuoteWerks.dbo.Products_QuoteWerks_Products AS PP WITH (NOLOCK) ON (OH.SetName = PP.ManufacturerPartNumber)
    INNER JOIN QuoteWerks.dbo.OptionsItems AS OI WITH (NOLOCK) ON (OH.ID = OI.SetID)
    INNER JOIN QuoteWerks.dbo.Products_QuoteWerks_Products AS PO WITH (NOLOCK) ON (OI.PartNumber = PO.ManufacturerPartNumber