help with a Query Expression (Builder)

  • Thread starter Thread starter jaberwocky
  • Start date Start date
J

jaberwocky

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 a
[HoursGiven] - [TotalhoursTaken], to give me a "RemainingHours" fiel
for multiple records. Sound simple. When i do this though i a
getting a popup box prompting me to put in a value fo
"TotalHoursTaken" though. If i enter a value say "10", then it take
that 10 and deducts it from my first record, and the query then treat
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

I have tried to ad an image here, but if it doesnt work then pleas
look at the attachment thanks
[image: http://crwinfocentre/accessquery.gif

+----------------------------------------------------------------
| Attachment filename: accessquery.gif
|Download attachment: http://www.MSAccessForum.com.com/forums/attachment.php?postid=209049
+----------------------------------------------------------------
 
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

I'm guessing that [TotalHoursTaken] is a calculated field... right?

You can't (usually) reuse a calculated field in a further calculation.
YOu'll need to recapitulate the expression used to calculate
TotalHoursTaken in the expression for RemainingHours. Perhaps you
could post the SQL view of the query, maybe it can be simplified!
 
Back
Top