Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2010
    Posts
    2

    Unanswered: Invalid procedure call in Access

    I have a data table with 4 relevant fields: Trace2, Trace4, CharID, and Value. I want to find the difference in TestValue between subsequent samples using queries.

    Q1: All records, one calculated field added (ASCII value of SampleID). 29029 records.
    [SELECT Data.Trace2, Data.Trace4, Data.CharID, Asc([Data.Trace4]) AS SampleNumeric, Data.Value
    FROM Data
    WHERE (((Data.CharID)=589) AND ((Data.Value) Between 70 And 72));]
    Q2: Same query, CharID and Value range criteria added. 77 records.
    [SELECT Data.Trace2, Data.Trace4, Data.CharID, Asc([Data.Trace4]) AS SampleNumeric, Data.Value
    FROM Data
    WHERE (((Data.CharID)=589) AND ((Data.Value) Between 70 And 72));]
    Q3: All fields from Q1 and Q2, plus two calculated fields, delta ASCII values of Trace4 and delta Value. This yielded 94 records due to a few crossproducts. I added a Trace2 criterion to give 6 records.
    [SELECT Query2.Trace2 AS Query2_Trace2, Query2.Trace4 AS Query2_Trace4, Query2.CharID AS Query2_CharID, Query2.SampleNumeric AS Query2_SampleNumeric, Query2.Value AS Query2_Value, Query2B.Trace2 AS Query2B_Trace2, Query2B.Trace4 AS Query2B_Trace4, Query2B.CharID AS Query2B_CharID, Query2B.SampleNumeric AS Query2B_SampleNumeric, Query2B.Value AS Query2B_Value, [Query2B]![SampleNumeric]-[Query2]![SampleNumeric] AS Expr1, [Query2B]![Value]-[Query2]![Value] AS Expr2
    FROM Query2B INNER JOIN Query2 ON (Query2B.CharID = Query2.CharID) AND (Query2B.Trace2 = Query2.Trace2)
    WHERE (((Query2.Trace2)="09000035"));]

    Here is what results look like:

    Q1Trace4 ASCII Q2Trace4 ASCII Q1Value Q2Value deltaASCII deltaValue
    a 97 a 97 70.3 70.3 0 0
    a 97 b 98 70.3 71.5 1 1.2
    a 97 c 99 70.3 69.3 2 -1
    b 98 a 97 71.5 70.3 -1 -1.2
    b 98 b 98 71.5 71.5 0 0
    b 98 c 99 71.5 69.3 1 -2.2

    The records with deltaASCII=1 are the ones which show a value and a "next sample" value. When I put a criterion of 1 in that field, I get the "Invalid procedure call". Seems like a no-brainer. Why?
    Last edited by rlauterbach; 08-23-10 at 12:28. Reason: Sinndho recommendation to add SQL.

  2. #2
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    You would get more aswers if you would post the SQL sentences of your queries.
    Have a nice day!

  3. #3
    Join Date
    Aug 2010
    Posts
    2
    Thanks for SQL recommendation. I was trying to simplify because the SQL seemed straightforward.

Posting Permissions

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