Re: query miscalculation

From: Alex (Alex_at_discussions.microsoft.com)
Date: 12/30/04


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]
> > >
>



Relevant Pages

  • Re: SysprepMassStorage Problem on Compaq servers
    ... would also cause problems with Mass Storage devices. ... that the syntax in the article led you to the right fix. ... > The link from John John wasn't exactly the fix; although, ... DELL RAID AND SCSI CONTROLLERS ...
    (microsoft.public.win2000.general)
  • Re: SysprepMassStorage Problem on Compaq servers
    ... would also cause problems with Mass Storage devices. ... that the syntax in the article led you to the right fix. ... > The link from John John wasn't exactly the fix; although, ... DELL RAID AND SCSI CONTROLLERS ...
    (microsoft.public.win2000.setup_deployment)
  • Re: SysprepMassStorage Problem on Compaq servers
    ... would also cause problems with Mass Storage devices. ... that the syntax in the article led you to the right fix. ... > The link from John John wasn't exactly the fix; although, ... DELL RAID AND SCSI CONTROLLERS ...
    (microsoft.public.windows.server.setup)
  • Re: [PATCH][INCOMPLETE] sata_nv: merge ADMA support
    ... That will fix ... My workaround has been to just use John Stultz's new timekeeping ... Our PostgreSQL servers now maintain ... and require an NTP restart every day or so. ...
    (Linux-Kernel)
  • Re: Walt Disney Biography
    ... Certainly will let you know if I come across a fix and appreciate your ... Mine is with Motion Pixels Codec, ... > John Sisker ... but the video will not display. ...
    (rec.arts.disney.parks)