something like, this is just the format,

you have to fill in the field names , represented by f1,f2,..fn in the statement below

Insert into TableX(f1,f2,...Fn)

select a.f1,a.f2, ..a.fn

from

(

SELECT

"DG1" As ["ID"],

Sum(IIf(Year([OrdrDate])=([Enter Year]-2) ,HDB.[GRQty],0)) AS ["prevYR2"],

Sum(IIf(Year([OrdrDate])=([Enter Year]-1) ,HDB.[GRQty],0)) AS ["prevYR"],

Sum(IIf(Year([OrdrDate])=([Enter Year]-1) AND Month([OrdrDate])<=([Enter Month]) ,HDB.[GRQty],0)) AS ["prevYTD"],

Sum(IIf(Year([OrdrDate])=([Enter Year]) AND Month([OrdrDate])<=([Enter Month]) ,HDB.[GRQty],0)) AS ["YTD"]

FROM HDB

WHERE

HDB.[GRQty] <= [Enter Bmax1] AND fmt = "DG"

GROUP BY 1

UNION SELECT

"DG2" As ["ID"],

Sum(IIf(Year([OrdrDate])=([Enter Year]-2) ,HDB.[GRQty],0)) AS ["prevYR2"],

Sum(IIf(Year([OrdrDate])=([Enter Year]-1) ,HDB.[GRQty],0)) AS ["prevYR"],

Sum(IIf(Year([OrdrDate])=([Enter Year]-1) AND Month([OrdrDate])<=([Enter Month]) ,HDB.[GRQty],0)) AS ["prevYTD"],

Sum(IIf(Year([OrdrDate])=([Enter Year]) AND Month([OrdrDate])<=([Enter Month]) ,HDB.[GRQty],0)) AS ["YTD"]

FROM HDB

WHERE

HDB.[GRQty] BETWEEN [Enter Bmin2] And [Enter Bmax2] AND fmt = "DG"

GROUP BY 1

) as a

you have to fill in the field names , represented by f1,f2,..fn in the statement below

Insert into TableX(f1,f2,...Fn)

select a.f1,a.f2, ..a.fn

from

(

SELECT

"DG1" As ["ID"],

Sum(IIf(Year([OrdrDate])=(

Sum(IIf(Year([OrdrDate])=(

Sum(IIf(Year([OrdrDate])=(

Sum(IIf(Year([OrdrDate])=(

FROM HDB

WHERE

HDB.[GRQty] <= [Enter Bmax1] AND fmt = "DG"

GROUP BY 1

UNION SELECT

"DG2" As ["ID"],

Sum(IIf(Year([OrdrDate])=(

Sum(IIf(Year([OrdrDate])=(

Sum(IIf(Year([OrdrDate])=(

Sum(IIf(Year([OrdrDate])=(

FROM HDB

WHERE

HDB.[GRQty] BETWEEN [Enter Bmin2] And [Enter Bmax2] AND fmt = "DG"

GROUP BY 1

) as a