Results 1 to 3 of 3
  1. #1
    Star Lounger
    Join Date
    Sep 2003
    Location
    Ocean Gate, New Jersey, USA
    Posts
    55
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Writing an expression (A2K)

    Hello,

    I need help in writing an expression or code that would allow for a range of say + or - 3 relating to a baseline number and then have anything outside the acceptable range print to a report to have re-inspected.

    My example is I have a database field that displays the number of turns on a valve (Valve Turns) to fully open or close depending on the size of the valve. This number is used as the baseline number for that size (4 inch = 14 turns, 6 inch = 20 turns, 8 inch = 26 turns, 10 inch = 32 turns, and 12 inch = 38 turns). If an inspection reveals a number that is unacceptable ( + or - 3) I would need the unacceptable valves in a report.

    Any help is always greatly appreciated.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Writing an expression (A2K)

    - Create a query based on the table with inspection data and on the table with the baseline data.
    - Join them on the valve size field.-
    - Add the fields from the inspection table that you want to see.
    - Add a calculated field

    Diff: Abs([ObservedTurns]-[BaselineTurns])

    where ObservedTurns must be replaced by the field from the inspection table that holds the number of turns, and BaselineTurns must be replaced by the number of turns in the table with the baseline data.

    - Set the criteria for this calculated field to >3.
    - Save the query.
    - Use it as record source for a report.

  3. #3
    Star Lounger
    Join Date
    Sep 2003
    Location
    Ocean Gate, New Jersey, USA
    Posts
    55
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Writing an expression (A2K)

    Hans,

    Thank you very much !

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •