Results 1 to 2 of 2
  1. #1
    anunat is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Jun 2012
    Posts
    19

    Using Derived Column in Where Condition

    I am making queries using VBA in Access.
    I have one query temp3 that returns several records with columns ID, Diff etc.
    I would like to filter the results of temp3 further using the condition temp3.[Diff] <> 0
    I could not use this condition within temp3 because Diff is a derived column.
    So I making another query temp4 as below:
    SELECT * FROM temp3
    WHERE temp3.[Diff] <> 0;
    When I run this Query, the records filter correctly. However, the Diff column is blank for all records.


    What am I doing wrong here?
    I also tried nesting temp 3 as below and get the same issue:
    select * from( Query temp3) as data where data.diff <> 0
    Can you please help me with this?

  2. #2
    help_me_with_access is offline help_me_with_excel
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    262
    perhaps the DIFF column is a different data type in the output of temp3?

    did you open it and look at it directly through the GUI??? what's the sql of temp3? are you sure the are actual values in the DIFF column for the 1st query too? maybe temp4 is right, but you're not checking what you're supposed to be checking and the error is in temp3 instead, or in the data???

    i think the alignment of the values also comes through directly in queries. so for instance, left is text, right is numeric vals. check that too, obviously.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 12-08-2011, 08:03 AM
  2. Derived Column with SQL equation and IIF
    By rivereridanus in forum Access
    Replies: 3
    Last Post: 08-16-2011, 05:46 PM
  3. Replies: 1
    Last Post: 04-15-2010, 02:07 AM
  4. Like condition for 1 column help pls!
    By stodd in forum Queries
    Replies: 1
    Last Post: 03-14-2010, 01:51 AM
  5. Calulating derived date in table
    By hedleyw in forum Access
    Replies: 2
    Last Post: 04-12-2009, 02:33 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums