Hi, how 2 declare and set values in the access query?
Hi, how 2 declare and set values in the access query?
Queries don't have variables; what is it you're trying to accomplish?
hi paul , I am trying to get some results from joining the tables and do some calculations on it. The problem is that I can't write multiple "select" or "insert" and "udate " in a single query.
Besides i found some where the syntax like
"PARAMETERS x IEEEDouble;
INSERT INTO CUSTOMER_DETAILS
VALUES ('xxx', 'YYY', '11111111', 'SASA');
" .
Doesn't give a syntax error but can's set a value for x.
binay,
that really didn't answer Paul's question. So what is it that you want to do again? INSERT values into a table? I thought you said that you wanted to perform calculations on your data? That would probably not involve an INSERT statement.
Hi Adam.
First i want to select sum of a row found from multiple tables joins. I can do that , no problem. But then i want to insert some values in another table based on the values of the first select.
I can't write a insert statement after a select statement. So i was wondering whether i can store that value in a variable by writing the select statement in the "set var= select...." of that variable.
Also i need if statement to check the value of the sum.
Doing these things in sql query is very simple but in access???
summing rows have to be done in separate fields. No other way to do it, really.
ummm...NO.But then i want to insert some values in another table based on the values of the first select.
I can't write a insert statement after a select statement. So i was wondering whether i can store that value in a variable by writing the select statement in the "set var= select...." of that variable.
so you want to insert the resulting SUM value into a new dataset, right? You can do that 2 ways easily:
- get the sum through a function and write the result of it into the INSERT statement, or...
- write one static query and reference it with the second query. One statement per query
I am not sure if you can include a function inside of a VALUES() statement, but you can try it. for instance, try:
Code:INSERT INTO newtable (field) VALUES (myfunction(argument))