Here it is. I figured it out and it is taking each field and adding it to
the end for exanple rb_self is 2654910 RB nonmgd is 34935 total would be
265491034935 plus all the other fields. I am at a total loss. Thank you for
your help.
INSERT INTO Revenue ( VPN, RB_Self, RB_MgdCare, RB_NonMgd, RB_MEDICARE,
RB_MAFFS, RB_MedChoice, RB_RES, RB_SCO, RB_NONMA, RB_VA, RB_OtherPayers,
RB_ADH, TOT_RB, ANC_Self, ANC_MGDCARE, ANC_NonMgd, ANC_MEDICARE, ANC_MAFFS,
ANC_mEDCHOICE, ANC_SCO, ANC_NONMA, ANC_VA, ANC_OtherPayers, Tot_Ancillary,
[REV NON_NURSING], REV_Misc, TOT_REV, Acct_3000, Var )
SELECT [Gather All Revenue Accts_Crosstab].VPN, NZ([Gather All Revenue
Accts_Crosstab]![3003_1]) AS RB_Self, NZ([Gather All Revenue
Accts_Crosstab]![3003_2]) AS RB_MgdCare, NZ([Gather All Revenue
Accts_Crosstab]![3003_3]) AS RB_NonMgd, NZ([Gather All Revenue
Accts_Crosstab]![3003_4]) AS RB_Medicare, NZ([Gather All Revenue
Accts_Crosstab]![3003_6])+NZ([Gather All Revenue
Accts_Crosstab]![3022_6])+NZ([Gather All Revenue Accts_Crosstab]![3003_7]) AS
RB_MAFFS, NZ([Gather All Revenue Accts_Crosstab]![3003_5]) AS RB_MedChoice,
NZ([Gather All Revenue Accts_Crosstab]![3026_3]) AS RB_res, NZ([Gather All
Revenue Accts_Crosstab]![3003_8]) AS RB_SCO, NZ([Gather All Revenue
Accts_Crosstab]![3022_7]) AS RB_NoNMA, NZ([Gather All Revenue
Accts_Crosstab]![3023_2]) AS RB_VA, NZ([Gather All Revenue
Accts_Crosstab]![3003_9]) AS rb_Other, NZ([Gather All Revenue
Accts_Crosstab]![3025_3])+NZ([Gather All Revenue
Accts_Crosstab]![3026_1])+NZ([Gather All Revenue
Accts_Crosstab]![3025_4])+NZ([Gather All Revenue
Accts_Crosstab]![3025_5])+NZ([Gather All Revenue Accts_Crosstab]![3026_2]) AS
RB_ADH,
Sum(nz([Rb_SELF],0)+nz([RB_Mgdcare],0)+nz([RB_nonmgd],0)+nz([RB_Medicare],0)+NZ([RB_MAFFS],0)+nz([RB_Medchoice],0)+nz([RB_Res],0)+NZ([RB_SCO],0)+NZ([RB_nonma],0)+NZ([RB_VA],0)+NZ([RB_ADH],0)+NZ([Rb_Other],0))
AS Tot_RB, NZ([Gather All Revenue Accts_Crosstab]![3005_1]) AS ANC_SELF,
NZ([Gather All Revenue Accts_Crosstab]![3005_2]) AS ANC_MGDCARE, NZ([Gather
All Revenue Accts_Crosstab]![3005_3]) AS ANC_NONMGD, NZ([Gather All Revenue
Accts_Crosstab]![3005_4]) AS ANC_MEDICARE, NZ([Gather All Revenue
AcCts_Crosstab]![3005_6])+NZ([Gather All Revenue
Accts_Crosstab]![3032_6])+NZ([Gather All Revenue Accts_Crosstab]![3005_7]) AS
ANC_MAFFS, NZ([Gather All Revenue Accts_Crosstab]![3005_5]) AS ANC_MEDCHOICE,
NZ([Gather All Revenue Accts_Crosstab]![3005_8]) AS ANC_SCO, NZ([Gather All
Revenue Accts_Crosstab]![3032_7]) AS ANC_NONMa, NZ([Gather All Revenue
Accts_Crosstab]![3033_2]) AS ANC_VA, NZ([Gather All Revenue
Accts_Crosstab]![3005_9]) AS ANC_Other,
NZ([ANC_Self])+NZ([ANC_Mgdcare])+NZ([ANC_nonmgd])+nz([ANC_Medicare])+NZ([ANC_maffs])+NZ([Anc_medchoice])+NZ([ANC_SCO])+NZ([ANC_nonma])+NZ([anc_VA])+NZ([ANC_Other])
AS TOT_ANC, NZ([Gather All Revenue Accts_Crosstab]![3026_0]) AS
Rev_NonNursing, NZ([Gather All Revenue Accts_Crosstab]![3130_0]) AS Rev_MISC,
NZ([Tot_RB])+NZ([Tot_ANC])+([Rev_MISC]) AS TOT_REV, [Gather All Revenue
Accts_Crosstab]![3000_0] AS Acct_3000, NZ([TOT_REV])-NZ([Acct_3000]) AS Var
FROM [Gather All Revenue Accts_Crosstab]
GROUP BY [Gather All Revenue Accts_Crosstab].VPN, NZ([Gather All Revenue
Accts_Crosstab]![3003_1]), NZ([Gather All Revenue Accts_Crosstab]![3003_2]),
NZ([Gather All Revenue Accts_Crosstab]![3003_3]), NZ([Gather All Revenue
Accts_Crosstab]![3003_4]), NZ([Gather All Revenue
Accts_Crosstab]![3003_6])+NZ([Gather All Revenue
Accts_Crosstab]![3022_6])+NZ([Gather All Revenue Accts_Crosstab]![3003_7]),
NZ([Gather All Revenue Accts_Crosstab]![3003_5]), NZ([Gather All Revenue
Accts_Crosstab]![3026_3]), NZ([Gather All Revenue Accts_Crosstab]![3003_8]),
NZ([Gather All Revenue Accts_Crosstab]![3022_7]), NZ([Gather All Revenue
Accts_Crosstab]![3023_2]), NZ([Gather All Revenue Accts_Crosstab]![3003_9]),
NZ([Gather All Revenue Accts_Crosstab]![3025_3])+NZ([Gather All Revenue
Accts_Crosstab]![3026_1])+NZ([Gather All Revenue
Accts_Crosstab]![3025_4])+NZ([Gather All Revenue
Accts_Crosstab]![3025_5])+NZ([Gather All Revenue Accts_Crosstab]![3026_2]),
NZ([Gather All Revenue Accts_Crosstab]![3005_1]), NZ([Gather All Revenue
Accts_Crosstab]![3005_2]), NZ([Gather All Revenue Accts_Crosstab]![3005_3]),
NZ([Gather All Revenue Accts_Crosstab]![3005_4]), NZ([Gather All Revenue
AcCts_Crosstab]![3005_6])+NZ([Gather All Revenue
Accts_Crosstab]![3032_6])+NZ([Gather All Revenue Accts_Crosstab]![3005_7]),
NZ([Gather All Revenue Accts_Crosstab]![3005_5]), NZ([Gather All Revenue
Accts_Crosstab]![3005_8]), NZ([Gather All Revenue Accts_Crosstab]![3032_7]),
NZ([Gather All Revenue Accts_Crosstab]![3033_2]), NZ([Gather All Revenue
Accts_Crosstab]![3005_9]), NZ([Gather All Revenue Accts_Crosstab]![3026_0]),
NZ([Gather All Revenue Accts_Crosstab]![3130_0]), [Gather All Revenue
Accts_Crosstab]![3000_0];
--
thank you mac
KARL DEWEY said:
Post the complete SQL statement.
--
KARL DEWEY
Build a little - Test a little
mac said:
Hello
I have an apped queryI have several fieds in my query and a total field
(which total s all the fields. When I run the append query all of the fields
append correctly except the total. Below is the total field
Tot_RB:
Sum(nz([RB_SELF],0)+nz([RB_Mgdcare],0)+nz([RB_nonmgd],0)+nz([RB_Medicare],0)+NZ([RB_MAFFS],0)+nz([RB_Medchoice],0)+nz([RB_Res],0)+NZ([RB_SCO],0)+NZ([RB_nonma],0)+NZ([RB_VA],0)+NZ([RB_ADH],0)+NZ([Rb_Other],0)
The total should be 4,799,335. The total I am getting is
137,287,517,245,003,000. Please what am I doing wrong. Any help wil be
greatly appreciated.