![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I have made a query called qryKøbSalg in my access 2007 database with the following columns. itemId ref to the table tblItemTransaction descrition ref to the table tblItem transDate ref to table tblItemTransaction transType ref to table tblItemTransaction kurs ref to table tblItemTransaction transQty ref to table tblItemTransaction TotalAktier do not ref to any table but I have this expressions: TotalAktier: (IIf([transType]='S';[transQty]*[Kurs];IIf([transType]='P';-[transQty]*[ Kurs]))) Omk ref to table tblItemTransaction When I enter keys in the query all data are automatically pasted into the table tblItemTransaction in the following columns itemId > itemId transType > transType transDate > transTade kurs > kurs transQty > transQty Omk > Omk My problem is the column TotalAktier which not are pasted into the tblItemTransaction table. Did I miss something in the expressions? Poul |
#3
| |||
| |||
|
|
You use ";" instead of "," for separating the fields. *I doubt it would run in Access. Ex: IIf([transType]='S'; In localised Acces if the standard for decimal point is comma, one has |
#4
| |||
| |||
|
|
My problem is the column TotalAktier which not are pasted into the tblItemTransaction table. |
|
IIf([transType]='S';[transQty]*[Kurs];IIf([transType]='P'.... If transType is not 'S' or 'P' then TotalAktier is Null. |
#5
| |||
| |||
|
|
You use ";" instead of "," for separating the fields. I doubt it would run in Access. Ex: IIf([transType]='S'; Is this an Update query? If so, select from the menu and select Query/Select. IOW, change it temporarily from and Update to Select. Then run the query. Is there a value in TotalAktier? If there is then there's a problem. Maybe you selected the wrong field to uodate. If there isn't, then you do have a problem with your expression. Remober to change the query back to Update query. |
#6
| |||
| |||
|
|
Salad wrote: You use ";" instead of "," for separating the fields. *I doubt it would run in Access. Ex: IIf([transType]='S'; Is this an Update query? *If so, select from the menu and select Query/Select. *IOW, change it temporarily from and Update to Select. Then run the query. *Is there a value in TotalAktier? *If there is then there's a problem. *Maybe you selected the wrong field to uodate. *If there isn't, then you do have a problem with your expression. *Remober to change the query back to Update query. I'm using semicolon because comma don’t work in access 2007 at least not in a query. But I have tried both. Yes there is a field called TotalAktier in both the tblItemTransaction table and in the query qryKøbSalg It is not a update query I use. (I don't know how to use an update query, I'm still a novice in access) Below there is a list of the column in the table "tblItemTransaction" itemId | transType | transDate| Kurs | transQty | transCost | TotalAktier And a list of my query *(qryKøbSalg) itemId | description | transType | transDate | Kurs | transQty | TotalAktier| transCost In the query i fill in the date in itemId, description, transType,transDate, Kurs, transQty and transCost. TotalAktier calculate automatically based on Kurs*transQty. No problem with this in the query. The problem is, that all data should be sent to the tblItemTransaction table from that query, and the data from all fields except from the TotalAktier did that. I write in the keys directly in the query into the table view. I'm wonder if I in this *syntax below should tell where the result should be placed which shoud be in the table tblItemTransaction and in the field TotalAktier, but I don't know how and where. TotalAktier: (IIf([transType]='S';[transQty]*[Kurs];IIf([transType]='P';-[transQty]*[ Kurs]))) -- |
#7
| |||
| |||
|
|
Salad wrote: You use ";" instead of "," for separating the fields. I doubt it would run in Access. Ex: IIf([transType]='S'; Is this an Update query? If so, select from the menu and select Query/Select. IOW, change it temporarily from and Update to Select. Then run the query. Is there a value in TotalAktier? If there is then there's a problem. Maybe you selected the wrong field to uodate. If there isn't, then you do have a problem with your expression. Remober to change the query back to Update query. I'm using semicolon because comma don’t work in access 2007 at least not in a query. But I have tried both. Yes there is a field called TotalAktier in both the tblItemTransaction table and in the query qryKøbSalg It is not a update query I use. (I don't know how to use an update query, I'm still a novice in access) Below there is a list of the column in the table "tblItemTransaction" itemId | transType | transDate| Kurs | transQty | transCost | TotalAktier And a list of my query (qryKøbSalg) itemId | description | transType | transDate | Kurs | transQty | TotalAktier| transCost In the query i fill in the date in itemId, description, transType,transDate, Kurs, transQty and transCost. TotalAktier calculate automatically based on Kurs*transQty. No problem with this in the query. The problem is, that all data should be sent to the tblItemTransaction table from that query, and the data from all fields except from the TotalAktier did that. I write in the keys directly in the query into the table view. I'm wonder if I in this syntax below should tell where the result should be placed which shoud be in the table tblItemTransaction and in the field TotalAktier, but I don't know how and where. TotalAktier: (IIf([transType]='S';[transQty]*[Kurs];IIf([transType]='P';-[transQty]*[ Kurs]))) |
#8
| |||
| |||
|
|
I have made a query called qryKøbSalg in my access 2007 database with the following columns. itemId *ref to the table tblItemTransaction descrition * * *ref to the table tblItem transDate * * * ref to table tblItemTransaction transType * * * ref to table tblItemTransaction kurs * *ref to table tblItemTransaction transQty * * * *ref to table tblItemTransaction TotalAktier * * do not ref to any table but I have this expressions: TotalAktier: (IIf([transType]='S';[transQty]*[Kurs];IIf([transType]='P';-[transQty]*[ Kurs]))) Omk * * ref to table tblItemTransaction When I enter keys in the query all data are automatically pasted into the table tblItemTransaction in the following columns itemId > itemId transType > transType transDate > transTade kurs > kurs transQty > transQty Omk > Omk My problem is the column TotalAktier which not are pasted into the tblItemTransaction table. Did I miss something in the expressions? Poul -- |
#9
| |||
| |||
|
|
Yes there is a field called TotalAktier in both the tblItemTransaction table and in the query qryKøbSalg It is not a update query I use. (I don't know how to use an update query, I'm still a novice in access) It should be an APPEND query. |
![]() |
| Thread Tools | |
| Display Modes | |
| |