Dear everyone,
I would like to join a prefix and a number which are separated by a "-" and do not know why it could not work for me. Can you please tell me why this code doesn't work:
=IIf([Prefix] Is Null,"",Trim$([prefix])) & “-“ & Right$(Str$([Voucher No]+10000),4) & IIf([Suffix] Is Null,"",Trim$([Suffix]))
It is in a report and always as me to Enter Parameter "
Otherwise the following works but without a "-"
=IIf([Prefix] Is Null,"",Trim$([prefix])) & Right$(Str$([Voucher No]+10000),4) & IIf([Suffix] Is Null,"",Trim$([Suffix]))
Cheers.
1 2065
Dear everyone,
I would like to join a prefix and a number which are separated by a "-" and do not know why it could not work for me. Can you please tell me why this code doesn't work:
=IIf([Prefix] Is Null,"",Trim$([prefix])) & “-“ & Right$(Str$([Voucher No]+10000),4) & IIf([Suffix] Is Null,"",Trim$([Suffix]))
It is in a report and always as me to Enter Parameter "
Otherwise the following works but without a "-"
=IIf([Prefix] Is Null,"",Trim$([prefix])) & Right$(Str$([Voucher No]+10000),4) & IIf([Suffix] Is Null,"",Trim$([Suffix]))
Cheers.
Hi, there.
Just a thought. Try to use IsNull() function instead of object comparisson operator "Is".
And BTW the expression could be simplified.
1. Concatenation operator "&" unlike math and logic operators doesn't work according to tristate logic.
e.g.
? "qwerty" + Null
Null
? "qwerty" & Null
qwerty
So check for Null value is not needed.
2. Expression -
Right$(Str$([Voucher No]+10000),4)
-
will return always the same as -
Right$(Str$([Voucher No]),4)
-
And, not concerning the problem, get reed of all this "$". This exists for backward compatability only and is supposed to be ceased in future.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Jim Hefferon |
last post by:
Hello,
I'm getting an error join-ing strings and wonder if someone can
explain why the function is behaving this way? If I .join in a string
that contains a high character then I get an ascii...
|
by: Leo Breebaart |
last post by:
I've tried Googling for this, but practically all discussions on
str.join() focus on the yuck-ugly-shouldn't-it-be-a-list-method?
issue, which is not my problem/question at all.
What I can't...
|
by: stabbert |
last post by:
I am attempting to join two tables together on two different unix
servers. Here is some relevant info about the tables.
TABLE 1 Setup
-----------------------
DB2 UDB 7.2 EE
|
by: Michael \(michka\) Kaplan [MS] |
last post by:
A little light humor... this "easter egg" was hidden deep in the Access 95
help system. I did not write it (I am not this creative and never was) and I
did not put it in the product (I was not on...
|
by: Bob |
last post by:
I have a function that takes in a list of IDs (hundreds) as input parameter
and needs to pass the data to another step as a comma delimited string. The
source can easily create this list of IDs in...
|
by: Steven |
last post by:
Hello,
I have a question about strcmp(). I have four words, who need to be
compared if it were two strings. I tried adding the comparison values
like '(strcmp(w1, w2) + strcmp(w3, w4))', where...
|
by: Sandra-24 |
last post by:
I'd love to know why calling ''.join() on a list of encoded strings
automatically results in converting to the default encoding. First of
all, it's undocumented, so If I didn't have non-ascii...
|
by: Paulo da Silva |
last post by:
Hi!
I was told in this NG that string is obsolet. I should use
str methods.
So, how do I join a list of strings delimited by a given
char, let's say ','?
Old way:
|
by: Matt Mackal |
last post by:
I have an application that occassionally is called upon to process
strings that are a substantial portion of the size of memory. For
various reasons, the resultant strings must fit completely in...
|
by: bearophileHUGS |
last post by:
Empty Python lists don't know the type of the items it will
contain, so this sounds strange:
0
Because that may be an empty sequence of someobject:
0
In a statically typed language in...
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
|
by: ryjfgjl |
last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
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...
|
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...
| |