473,396 Members | 1,683 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

what wrong with iif funtion ?

215 128KB
Hi guy, I come back with new issue
I have a code like this
Expand|Select|Wrap|Line Numbers
  1. Iif(           
  2.     len([a])>2,  [a]& iif( 
  3.                           len([b])>2,  ”, “&[b]& iif(
  4.                                                     len([c])>2,                ” ,”&[c]
  5.                                                      ,“”
  6.                                                      )
  7.                                     ,iif( 
  8.                                          len([c])>2, “, “&[c]
  9.                                                    , “”
  10.                                          ) 
  11.                           )
  12.               ,iif(
  13.                     len([b])>2,  [b]& iif(
  14.                                           len([c])>2, ” ,”&[c]
  15.                                                     ,“”
  16.                                           )
  17.                               ,iif(
  18.                                    len([c])>2, [c]
  19.                                              ,“.”
  20.                                    ) 
  21.                    )
  22. )
  23.  
when I use this in access, in expression, It showed up error "the expression you entered has a function containing wrong number of arguments"

Any idea :-? help me, thankyou :D
Sep 8 '15 #1
5 1096
Seth Schrock
2,965 Expert 2GB
Nothing jumps out at me. Try removing all of your nested IIF()s and just start back with just the first one, replacing the IIF with some static text to show which path (true or false) the result came from. If the first one works, then add another one. Keep going through this pattern until you figure out what breaks it.
Sep 8 '15 #2
hvsummer
215 128KB
I find out that the "" make this problem =.=
since I type code in word to mark code by color, then copy into access. When I remove those "" and replace by typing it againt, it did work... weird case...
Sep 9 '15 #3
Rabbit
12,516 Expert Mod 8TB
Some word processors will change the standard double quotes found on the keyboard to a stylized version that is technically a different character.
Sep 9 '15 #4
NeoPa
32,556 Expert Mod 16PB
HVSummer:
... since I type code in Word to mark code by color, then copy into access.
Never do that. Never trust Word to do your code in. Not VBA. Not SQL. It will usually muck it up for you because that's not a job it's designed to do. It's designed as a Word Processor.

Find yourself a Text Editor to use if you need to work outside of the natural environment (VBA IDE or SSMS for T-SQL). TextPad and Notepad++ are both good but as long as you find one that works for you then whichever is fine.

Whatever you do though, never use Word or any other Word Processor for developing code.
Sep 12 '15 #5
As others have said, NEVER use a word processor to code! Use Notepad++ or (my preference) UltraEdit. Your word processor is probably entering the hex string E2 80 9C for your quote marks, instead of the hex character 22. At least, that's what I get in UltraEdit from scraping your code and also from checking out Libre Office Write.

BTW, there doesn't seem to be anything syntactically incorrect with your code :)


Good Luck

Mike
Sep 13 '15 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Lee Redeem | last post by:
Hi there I've created abd uploaded this basic PHP script: <html> <head> <title>PHP Test</title> </head> <body> <H1 align="center">
4
by: Fang | last post by:
Hi, I'm new to PHP. I followed an example on the book and wanted to pass a variable from one html page to a php page, but it always tells me the passed variable is undefined. I've checked the...
5
by: Koen | last post by:
Hi all, I am experimenting with DAO. I wrote this sub to update one specific field of one specific row in one specific table. Nothing wrong with the SQL statement, but when I execute this I get...
6
by: lucifer | last post by:
hi i need to insert delay in my program what function should i use the old delay is not supported by the VC6
8
by: Polaris | last post by:
Hi Experts: The program creates Panels and inicilize them. When I run the code below, the program crashes (at the line commented below). Any help is appriciated. Thanks in Advance! Polaris ...
2
by: MikeY | last post by:
Hi Everyone, I'm having problems with my syntax on the updating part for the Northwind.MDB. All other code seems fine. It has to do with the Order Details on the thisAdapter.Update( ). Or I...
14
by: howa | last post by:
void reverse_string(char *str) { if (str == NULL) return; char tmp; size_t len = strlen(str); size_t mid = (int) len / 2; for (size_t i = 0; i < mid; i++) {
2
by: doudou88 | last post by:
Hello, I try to debug a c# program using mono-debugger. But i need first to create .exe.mdb file, using the folowing command: gmcs -debug program.cs When doing this I get the following error:...
3
by: muddasirmunir | last post by:
I am trying to give the following Icon in my form in vb6. http://www.mediafire.com/?ymzgkgyi50j But , when I put this in my form I got error "Invalid Picutre" What wrong in it? How to add...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.