Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2004

    Unanswered: help with ACCESS Query Expression Builder

    I know this has got to be simple but i am having problems.
    I have a query that gives me 2 fields (HoursGiven and TotalHoursTaken). I am trying to use Builder to come up with an Expression such as [HoursGiven] - [TotalhoursTaken], to give me a "RemainingHours" field for multiple records. Sound simple. When i do this though i am getting a popup box prompting me to put in a value for "TotalHoursTaken" though. If i enter a value say "10", then it takes that 10 and deducts it from my first record, and the query then treats the rest of my records giving proper answer for my "RemainingHours". See the attachment

    In my Field i am using 'RemainingHours: [HoursGiven]-[TotalHoursTaken]'(no quotes)

    HELLPPPP what am i doing wrong
    Attached Thumbnails Attached Thumbnails accessquery.gif  
    still in the baby steps of coding

  2. #2
    Join Date
    Mar 2004
    omg, i've never think that someone can use builder, i always write sql statement and look what builder show only for fun. show sql view, it will be much easier, to help.

  3. #3
    Join Date
    Feb 2004
    You cannot reference a calculated field or an aliased field in the same query it was created in. Where You reference TotalHoursTaken in the calculation you need to put in the calculation instead

    Or remove the remaining hours calculation from this query and create another query with the first query added and do your final cal there.

    Either way will work.

Posting Permissions

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