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

Immediate IIF() problem



 
 
Thread Tools Display Modes
  #1  
Old May 19th, 2007, 02:59 PM posted to microsoft.public.access.queries
Marc Miller
external usenet poster
 
Posts: 1
Default Immediate IIF() problem

I have a string field with 'numeric' values (abbas) and another string
field (abbas_sign) that contains the indicator for the value's sign. It
contains
a 'D' if the first field is a positive number or a 'C' if it is negative.

I need to query the table and transform the string values into numeric
output depending on the sign.

Here is my clause:

SELECT Mid(abalc,17,4) AS pt32_acct,
IIF([abbas_sign] = 'D',CDec([abbas]), CDec([abbas]) * -1) as Amount
FROM faloadCO
GROUP BY faloadCO.abalc;

I'm receiving a 'Wrong number of arguments' used in the funtion.

Any help is appreciated.

Thank you for your time;
Marc MIller


  #2  
Old May 19th, 2007, 03:33 PM posted to microsoft.public.access.queries
Douglas J. Steele
external usenet poster
 
Posts: 9,313
Default Immediate IIF() problem

Are you sure that it's the function that's returning the "Wrong number of
arguments"? Might it be how you're using the SQL? It might help to show more
of your VBA code.

Also, what are your regional settings? Might your List Separator be set to
something other than comma?

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"Marc Miller" wrote in message
...
I have a string field with 'numeric' values (abbas) and another string
field (abbas_sign) that contains the indicator for the value's sign. It
contains
a 'D' if the first field is a positive number or a 'C' if it is negative.

I need to query the table and transform the string values into numeric
output depending on the sign.

Here is my clause:

SELECT Mid(abalc,17,4) AS pt32_acct,
IIF([abbas_sign] = 'D',CDec([abbas]), CDec([abbas]) * -1) as
Amount
FROM faloadCO
GROUP BY faloadCO.abalc;

I'm receiving a 'Wrong number of arguments' used in the funtion.

Any help is appreciated.

Thank you for your time;
Marc MIller



 




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 07:10 PM.


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