Re: query miscalculation
From: Alex (Alex_at_discussions.microsoft.com)
Date: 12/30/04
- Next message: Dan Artuso: "Re: Calculating the proper price"
- Previous message: Jack MacDonald: "Re: Calculating the proper price"
- In reply to: John Spencer (MVP): "Re: query miscalculation"
- Next in thread: Alex: "Re: query miscalculation"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 30 Dec 2004 08:27:04 -0800
You are right, John.
I have records with Null for the AdditionCode.
How could I fix it to get it working?
Thanks
"John Spencer (MVP)" wrote:
> A guess, but do you have any records where the AdditionCode is Null. If so,
> applying criteria will drop the records with null values as well as any others
> you are trying to exclude.
>
> Alex wrote:
> >
> > Thanks, John.
> > I did it but the same result: the sum of [PayrollWorkedTime] is 6,645.25
> > instead of 6,657.
> > I'll try to find which row gives this mistake.
> >
> > "John Vinson" wrote:
> >
> > > On Wed, 29 Dec 2004 16:31:03 -0800, "Alex"
> > > <Alex@discussions.microsoft.com> wrote:
> > >
> > > >AND ((tblAdjustedData.AdditionCode)<>"L" And
> > > >(tblAdjustedData.AdditionCode)<>"P" And (tblAdjustedData.AdditionCode)<>"W"));
> > >
> > > >I've checked the result of the query without WHERE in Excel, calculating "L"
> > > >and "P" separately there. Everything is correct. It should be 6,810.5 for
> > > >all, 65.5 for "L", and 88 for "P". But, with the criteria <>"L" And <> "P"
> > > >it's not working in Access.
> > >
> > > Well, if the code is P then it's certainly not equal to L; and if it's
> > > L, it's certainly not W. Therefore the clause above will return all
> > > records with non-NULL addition codes.
> > >
> > > Change that portion of the Where clause to
> > >
> > > AND tblAdjustedData.AdditionCode NOT IN("L", "P", "W")
> > >
> > >
> > > John W. Vinson[MVP]
> > >
>
- Next message: Dan Artuso: "Re: Calculating the proper price"
- Previous message: Jack MacDonald: "Re: Calculating the proper price"
- In reply to: John Spencer (MVP): "Re: query miscalculation"
- Next in thread: Alex: "Re: query miscalculation"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|