If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Other > help with ACCESS Query Expression Builder

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-04-04, 17:47
jaberwocky jaberwocky is offline
Registered User
 
Join Date: Feb 2004
Location: Vancouver
Posts: 17
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
thanks
Attached Images
File Type: gif accessquery.gif (30.0 KB, 862 views)
__________________
still in the baby steps of coding
Reply With Quote
  #2 (permalink)  
Old 03-04-04, 18:56
fanlegii fanlegii is offline
Registered User
 
Join Date: Mar 2004
Posts: 2
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.
Reply With Quote
  #3 (permalink)  
Old 03-05-04, 18:23
AZ KC AZ KC is offline
Registered User
 
Join Date: Feb 2004
Posts: 142
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.
__________________
KC
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On