Append query with some field values constant

What is the syntax to append a constant value to a table?

Something like...

INSERT INTO tblResults(ProgramGroupIndex, ProgramIndex, Rank, Item)
SELECT "1", "1", tblIntermed.Rank, tblIntermed.Item
FROM tblIntermed


strSQL = _
    "INSERT INTO tblFinalOutput (ProgramGroupIndex, ProgramIndex, Rank, Item, RDCNumber, Alignment, ChannelType, FreightPayment, Sourcing, Flow, ChannelNumber, ContainerSize, LandingCoast, Consolidation, FreightType, GOSTRAT, MiscAddOn1, FacilityOHCost, StoreOHCost, TransitCost, TotInvCost, Inbd, Obd, TotFrt, FacilityRDC, Store, TotHand, FacilityOHDol, StoreOHDol, TransitDol, TotInvDol, DOS_F_Inter, DOS_S_Inter, DollarVolume, CubeVolume, WtVolume, TotSales, TotalPallets, COGS, COGSAfterRebate, COGSAfterRebateShrink, ConsolidationCost, ConCOGSAddon, LGSFee, Duties, BALCFee, OtherImpFee, Inv_SSFacilityUnit, Inv_SSStoreUnit, Inv_CycleFacilityUnit, Inv_CycleStoreUnit, Inv_PMinStoreUnit, Inv_SSFacilityCost, Inv_SSStoreCost, Inv_CycleFacilityCost, Inv_CycleStoreCost, Inv_TIVendor2FacilityCost, Inv_TIFacility2RDCCost, Inv_TIRDC2StoreCost, Inv_PMinStoreCost, Inv_VendorTermsCost, Inv_SSFacilityDol, Inv_SSStoreDol, Inv_CycleFacilityDol, Inv_CycleStoreDol, " + _
    " Inv_TIVendor2FacilityDol, Inv_TIFacility2RDCDol, Inv_TIRDC2StoreDol, Inv_PMinStoreDol, Inv_VendorTermsDol, TSLFac, TSLStore, RevByItem, ProfitByItem, OHSSCubeFac, OHSSCubeStore, OHCICubeFac, OHCICubeStore, SPMCube, OccupancyCost, CurrentFacTSL, CurrentStoreTSL, SellingWeeks, DemandPerYr, StockedStores, OutboundSU, OutboundSUClass, StockOutDaysFac, LSM, CurrentJobLot, ProposedJobLot, JobLotIncrease, OBTransCostForItemELC, HandCostForItemELC)" + _
    " SELECT [qry-TopSolItemLevel_Final].Rank, [qry-TopSolItemLevel_Final].Item, [qry-TopSolItemLevel_Final].RDCNumber, [qry-TopSolItemLevel_Final].Alignment, [qry-TopSolItemLevel_Final].ChannelType, [qry-TopSolItemLevel_Final].FreightPayment, [qry-TopSolItemLevel_Final].Sourcing, [qry-TopSolItemLevel_Final].Flow, [qry-TopSolItemLevel_Final].ChannelNumber, [qry-TopSolItemLevel_Final].ContainerSize, [qry-TopSolItemLevel_Final].LandingCoast, [qry-TopSolItemLevel_Final].Consolidation, [qry-TopSolItemLevel_Final].FreightType, [qry-TopSolItemLevel_Final].GOSTRAT, [qry-TopSolItemLevel_Final].MiscAddOn1, [qry-TopSolItemLevel_Final].FacilityOHCost, [qry-TopSolItemLevel_Final].StoreOHCost, [qry-TopSolItemLevel_Final].TransitCost, [qry-TopSolItemLevel_Final].TotInvCost, [qry-TopSolItemLevel_Final].Inbd, [qry-TopSolItemLevel_Final].Obd, [qry-TopSolItemLevel_Final].TotFrt, [qry-TopSolItemLevel_Final].FacilityRDC, [qry-TopSolItemLevel_Final].Store, [qry-TopSolItemLevel_Final].TotHand," + _
    " [qry-TopSolItemLevel_Final].FacilityOHDol , [qry-TopSolItemLevel_Final].StoreOHDol, [qry-TopSolItemLevel_Final].TransitDol, [qry-TopSolItemLevel_Final].TotInvDol, [qry-TopSolItemLevel_Final].DOS_F_Inter, [qry-TopSolItemLevel_Final].DOS_S_Inter, [qry-TopSolItemLevel_Final].DollarVolume, [qry-TopSolItemLevel_Final].CubeVolume, [qry-TopSolItemLevel_Final].WtVolume, [qry-TopSolItemLevel_Final].TotSales, [qry-TopSolItemLevel_Final].TotalPallets, [qry-TopSolItemLevel_FinalDetail].COGS, [qry-TopSolItemLevel_FinalDetail].COGSAfterRebate, [qry-TopSolItemLevel_Final].COGSAfterRebateShrink, [qry-TopSolItemLevel_FinalDetail].ConsolidationCost, [qry-TopSolItemLevel_FinalDetail].ConCOGSAddon, [qry-TopSolItemLevel_FinalDetail].LGSFee, [qry-TopSolItemLevel_FinalDetail].Duties, [qry-TopSolItemLevel_FinalDetail].BALCFee1, [qry-TopSolItemLevel_FinalDetail].OtherImpFee, [qry-TopSolItemLevel_FinalDetail].Inv_SSFacilityUnit," + _
    " [qry-TopSolItemLevel_FinalDetail].Inv_SSStoreUnit, [qry-TopSolItemLevel_FinalDetail].Inv_CycleFacilityUnit, [qry-TopSolItemLevel_FinalDetail].Inv_CycleStoreUnit, [qry-TopSolItemLevel_FinalDetail].Inv_PMinStoreUnit, [qry-TopSolItemLevel_FinalDetail].Inv_SSFacilityCost, [qry-TopSolItemLevel_FinalDetail].Inv_SSStoreCost, [qry-TopSolItemLevel_FinalDetail].Inv_CycleFacilityCost, [qry-TopSolItemLevel_FinalDetail].Inv_CycleStoreCost, [qry-TopSolItemLevel_FinalDetail].Inv_TIVendor2FacilityCost," + _
    " [qry-TopSolItemLevel_FinalDetail].Inv_TIFacility2RDCCost, [qry-TopSolItemLevel_FinalDetail].Inv_TIRDC2StoreCost, [qry-TopSolItemLevel_FinalDetail].Inv_PMinStoreCost, [qry-TopSolItemLevel_FinalDetail].Inv_VendorTermsCost, [qry-TopSolItemLevel_FinalDetail].Inv_SSFacilityDol, [qry-TopSolItemLevel_FinalDetail].Inv_SSStoreDol, [qry-TopSolItemLevel_FinalDetail].Inv_CycleFacilityDol, [qry-TopSolItemLevel_FinalDetail].Inv_CycleStoreDol, [qry-TopSolItemLevel_FinalDetail].Inv_TIVendor2FacilityDol, [qry-TopSolItemLevel_FinalDetail].Inv_TIFacility2RDCDol, [qry-TopSolItemLevel_FinalDetail].Inv_TIRDC2StoreDol, [qry-TopSolItemLevel_FinalDetail].Inv_PMinStoreDol, [qry-TopSolItemLevel_FinalDetail].Inv_VendorTermsDol," + _
    " [qry-TopSolItemLevel_FinalDetail].TSLFac, [qry-TopSolItemLevel_FinalDetail].TSLStore, [qry-TopSolItemLevel_FinalDetail].RevByItem, [qry-TopSolItemLevel_FinalDetail].ProfitByItem, [qry-TopSolItemLevel_FinalDetail].OHSSCubeFac, [qry-TopSolItemLevel_FinalDetail].OHSSCubeStore, [qry-TopSolItemLevel_FinalDetail].OHCICubeFac, [qry-TopSolItemLevel_FinalDetail].OHCICubeStore, [qry-TopSolItemLevel_FinalDetail].SPMCube, [qry-TopSolItemLevel_FinalDetail].OccupancyCost, [qry-TopSolItemLevel_FinalDetail].CurrentFacTSL, [qry-TopSolItemLevel_FinalDetail].CurrentStoreTSL, [qry-TopSolItemLevel_FinalDetail].SellingWeeks, [qry-TopSolItemLevel_FinalDetail].DemandPerYr, [qry-TopSolItemLevel_FinalDetail].StockedStores, [qry-TopSolItemLevel_FinalDetail].OutboundSU, [qry-TopSolItemLevel_FinalDetail].OutboundSUClass, [qry-TopSolItemLevel_FinalDetail].StockOutDaysFac, [qry-TopSolItemLevel_FinalDetail].LSM, [qry-TopSolItemLevel_FinalDetail].CurrentJobLot, " + _
    " [qry-TopSolItemLevel_FinalDetail].ProposedJobLot, [qry-TopSolItemLevel_FinalDetail].JobLotIncrease, [qry-TopSolItemLevel_FinalDetail].OBTransCostForItemELC, [qry-TopSolItemLevel_FinalDetail].HandCostForItemELC" + _
    " FROM [qry-TopSolItemLevel_Final] INNER JOIN [qry-TopSolItemLevel_FinalDetail] ON ([qry-TopSolItemLevel_Final].Item = [qry-TopSolItemLevel_FinalDetail].Item) AND ([qry-TopSolItemLevel_Final].RDCNumber = [qry-TopSolItemLevel_FinalDetail].RDCNumber);"
    Call subCreateGenericQuery("qryFinalOutput", strSQL)

Open in new window

ltdanp22Asked:
Who is Participating?
 
Aneesh RetnakaranDatabase AdministratorCommented:
>Something like...

>INSERT INTO tblResults(ProgramGroupIndex, ProgramIndex, Rank, Item)
?SELECT "1", "1", tblIntermed.Rank, tblIntermed.Item
> FROM tblIntermed


seems fine, which databse
0
 
ltdanp22Author Commented:
just wanted to make sure.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.