By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,476 Members | 1,529 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,476 IT Pros & Developers. It's quick & easy.

Help. Two Unknown Values in Query

P: 3
Hi every body:
I have program store which appeared the new salary to the unit out
The problem is: 2 values unknown (out_salary,out_amount)
The table(info) contain 8 fields (id,code_store,code_unit,date_rec,in_quantity,in_s alary,in_amount,out_quantity)
The quiry must give me the following result:
[id]
[code_store]
[code_unit]
[date_rec]
[In_quantity]
[in_salary]
[in_amount]
[out_quantity]
[out_salary] "take from [new_salary]
[out_amount] = [out_quantity]*[out_salary]
[sum_quantity] "accumulative summation" (In_quantity]- [out_quantity])
[sum_amount]" "accumulative summation" ([in_amount]- [out_amount])
[New_salary] =([In_quantity]- [out_quantity])/ ([in_amount]- [out_amount])

At last the report appeared as this
Attached Files
File Type: zip store.zip (15.4 KB, 31 views)
File Type: doc store.doc (33.0 KB, 101 views)
Mar 3 '14 #1
Share this Question
Share on Google+
4 Replies


Expert 100+
P: 1,221
You need to create those fields, they are not already in your data. So you cannot just reference them, you need to create them. Your SQL code for the query should contain something like this:
Expand|Select|Wrap|Line Numbers
  1. [new_salary] AS out_salary,[out_quantity]*[in_salary] as [out_amount] 
If you're using the query editor (GUI) you'll have columns like this:
out_amount:[new_salary]*[out_quantity]
out_salary:[new_salary]

Where a new field is simply a copy of an old field, you just need to select it and rename with the AS directive. In the editor you simply add a label, a colon and then the name of the old field.

Jim
Mar 4 '14 #2

P: 3
hello mr.jim
I need the query this :
Expand|Select|Wrap|Line Numbers
  1. [new_salary] AS out_salary,[out_quantity]*[out
  2. _salary] as [out_amount] 
but based on this query happend error because the value of new_salary is taking from
Expand|Select|Wrap|Line Numbers
  1. ([In_quantity]- [out_quantity])/ ([in_amount]- [out_amount]
one unknown value is depend on unknown value
if you have the slove can you apply on my database please
thank you
Mar 4 '14 #3

Expert 100+
P: 1,221
But out_salary is just another name for new_salary. If you simply change
[out_quantity]*[out_salary]
to
[out_quantity]*[new_salary]
the problem goes away.

Jim
Mar 6 '14 #4

P: 3
no problem Mr.Jim
[out_salary] =[new_salary]
what is the benefit from this
can you explain to me please
Mar 6 '14 #5

Post your reply

Sign in to post your reply or Sign up for a free account.