SQL Query problem

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Carl Howarth (carl.howarth_at_m-s-solutions.co.uk)
Date: 04/27/04


Date: Tue, 27 Apr 2004 10:57:55 +0100

Hi there,

I am attempting to create a query that works out a percentage and produces
counts where percentages are between certain levels. I have to use case
statements to pull back the correct figures to work out the percentages
with, however when I query on the results criterion entered appears to be
ignored/confused:

WHERE CAST(((case value1a when 0 then value2a else value1a end /
  case value1b when 0 then value2b else value1b end) * 100) AS
DECIMAL(10,2)) BETWEEN 0 AND 10

This pulls back data where the values of the above calculation are not
actually between 0 and 10.

Any ideas please?

Cheers, Carl
carl.howarth@m-s-solutions.co.uk



Relevant Pages

  • Re: Info Not updating in table when calculation done in form.
    ... I will need to use a query to build this ... data if I want to pull an report from this database. ... not update themselfs on the table when the calculation are done on the form. ... I wanted to use the table as my base to build reports ...
    (microsoft.public.access.forms)
  • Re: error pulling data from query using a command button on a form
    ... You can't refer to fields in queries that way. ... What is DET1PERSONNEL1 Query? ... > 'I am attempting to pull data from a column in a query. ... > Private Sub UpDateSingleRecord_Click ...
    (microsoft.public.access.forms)
  • Re: Access Table Sorting/Query Last Function
    ... The table is set up as a datasheet. ... of the Lastin your totals query. ... I've been designing a database that basically works off two tables. ... I've done this so that I can pull the last entered ...
    (microsoft.public.access.tablesdbdesign)
  • Re: Access Table Sorting/Query Last Function
    ... I've put in a number of test entries to ensure it works, ... of the Lastin your totals query. ... I've been designing a database that basically works off two tables. ... I've done this so that I can pull the last entered ...
    (microsoft.public.access.tablesdbdesign)
  • Re: Rolling dates from text field
    ... What is the calculation that I should be ... putting in the criteria of a query to pull the previous 6 months of data. ...
    (microsoft.public.access.formscoding)