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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Make positive number negitive
Budget is our income and sometimes this is positive. I need to make this
column in a query all negitive values. I am using the IIf function but it is not working. Budget: [budget_amount] IIf ([budget_amount] =0, [budget_amount]*-1, [budget_amount]) or is there another function I could use? |
#2
|
|||
|
|||
Make positive number negitive
On Mon, 29 Oct 2007 19:18:00 -0700, Tamm Fox wrote:
Budget is our income and sometimes this is positive. I need to make this column in a query all negitive values. I am using the IIf function but it is not working. Budget: [budget_amount] IIf ([budget_amount] =0, [budget_amount]*-1, [budget_amount]) or is there another function I could use? In a query? Budget:IIf ([budget_amount] =0, [budget_amount]*-1, [budget_amount]) All values will be negative. -- Fred Please respond only to this newsgroup. I do not reply to personal e-mail |
#3
|
|||
|
|||
Make positive number negitive
On Mon, 29 Oct 2007 19:18:00 -0700, Tamm Fox wrote:
Budget is our income and sometimes this is positive. I need to make this column in a query all negitive values. I am using the IIf function but it is not working. Budget: [budget_amount] IIf ([budget_amount] =0, [budget_amount]*-1, [budget_amount]) or is there another function I could use? "fredg" wrote: In a query? Budget:IIf ([budget_amount] =0, [budget_amount]*-1, [budget_amount]) All values will be negative. -- Fred Please respond only to this newsgroup. I do not reply to personal e-mail Fred Thank you. Yes when i realised that i posted this in the report section, I then posted it in the query section. but still it does not work. I dont know whats wrong. I deleted what i had in the expression builder, coppied what you wrote and pasted it directly in expression builder. for the "Field" row (and subitiuted "budget" for "budget_amount"). ERROR: syntax error (comma) in query expression 'dbo_jobcactb.[IIf(budget_amount]=0,[budget_amount]*-1,[budget_amount])]'. (NOTE: "dbo_jobcactb" is the table that "Budget" comes from and the outside [] is put in the error itself). (NOTE: "Budget:" was just what i renamed the column from "budget_amount"). I have tried deleting the comma but still does not help. Am i missing something somewhere? |
#4
|
|||
|
|||
Make positive number negitive
On Mon, 29 Oct 2007 19:18:00 -0700, Tamm Fox wrote:
Budget is our income and sometimes this is positive. I need to make this column in a query all negitive values. I am using the IIf function but it is not working. Budget: [budget_amount] IIf ([budget_amount] =0, [budget_amount]*-1, [budget_amount]) or is there another function I could use? "fredg" wrote: In a query? Budget:IIf ([budget_amount] =0, [budget_amount]*-1, [budget_amount]) All values will be negative. -- Fred Please respond only to this newsgroup. I do not reply to personal e-mail Fred Thank you. Yes when i realised that i posted this in the report section, I then posted it in the query section. but still it does not work. I dont know whats wrong. I deleted what i had in the expression builder, coppied what you wrote and pasted it directly in expression builder. for the "Field" row (and subitiuted "budget" for "budget_amount"). ERROR: syntax error (comma) in query expression 'dbo_jobcactb.[IIf(budget_amount]=0,[budget_amount]*-1,[budget_amount])]'. (NOTE: "dbo_jobcactb" is the table that "Budget" comes from and the outside [] is put in the error itself). (NOTE: "Budget:" was just what i renamed the column from "budget_amount"). I have tried deleting the comma but still does not help. Am i missing something somewhere? "Tamm Fox" wrote: I was trying to do all the calulations within the column that the data was in. for some reason access didnt like this. Workaround: i created another column next to the budget column and used: Budget_2:IIf ([budget_amount] =0, [budget_amount]*-1, [budget_amount]) |
Thread Tools | |
Display Modes | |
|
|