A Microsoft Office (Excel, Word) forum. OfficeFrustration

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   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Make positive number negitive



 
 
Thread Tools Display Modes
  #1  
Old October 30th, 2007, 02:18 AM posted to microsoft.public.access.reports
Tamm Fox
external usenet poster
 
Posts: 8
Default 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  
Old October 30th, 2007, 03:57 AM posted to microsoft.public.access.reports
fredg
external usenet poster
 
Posts: 4,386
Default 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  
Old October 30th, 2007, 04:53 AM posted to microsoft.public.access.reports
Tamm Fox
external usenet poster
 
Posts: 8
Default 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  
Old October 30th, 2007, 05:06 AM posted to microsoft.public.access.reports
Tamm Fox
external usenet poster
 
Posts: 8
Default 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

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:07 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.