using len & IIf statement

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a field in a query as follows:

GCRS: IIf(Len([combined]>3),Right([combined],3),"")

When I run the query I get #Error all the way down the query. What am I
doing wrong?

What I'm trying to get is if the field [combined] has more than 3 characters
in it, I want the field GCRS to display the last 3 characters of the
[combined] field, or else just be blank
 
Donna said:
I have a field in a query as follows:

GCRS: IIf(Len([combined]>3),Right([combined],3),"")

When I run the query I get #Error all the way down the query. What am I
doing wrong?

What I'm trying to get is if the field [combined] has more than 3 characters
in it, I want the field GCRS to display the last 3 characters of the
[combined] field, or else just be blank

Your syntax is wrong. The closing ) on the Len() function needs to be before the
 
Donna, please don't multi-post (the same question separately to different
newsgroups). Your question was already answered in .queries newsgroup before
Rick got to it here. if you had cross-posted, or preferrably posted to one
newsgroup only, he could have saved himself the trouble.


Rick Brandt said:
Donna said:
I have a field in a query as follows:

GCRS: IIf(Len([combined]>3),Right([combined],3),"")

When I run the query I get #Error all the way down the query. What am I
doing wrong?

What I'm trying to get is if the field [combined] has more than 3 characters
in it, I want the field GCRS to display the last 3 characters of the
[combined] field, or else just be blank

Your syntax is wrong. The closing ) on the Len() function needs to be before the
operator.
 
tina said:
Donna, please don't multi-post (the same question separately to different
newsgroups). Your question was already answered in .queries newsgroup before
Rick got to it here. if you had cross-posted, or preferrably posted to one
newsgroup only, he could have saved himself the trouble.


Rick Brandt said:
Donna said:
I have a field in a query as follows:

GCRS: IIf(Len([combined]>3),Right([combined],3),"")

When I run the query I get #Error all the way down the query. What
am
I
doing wrong?

What I'm trying to get is if the field [combined] has more than 3 characters
in it, I want the field GCRS to display the last 3 characters of the
[combined] field, or else just be blank

Your syntax is wrong. The closing ) on the Len() function needs to be before the
operator.
 
The only reason I posted it twice was because the first time I had chosen the
area "Query" and didn't notice that it changed back to the default of
Import/Export Data when I went to type the new question. Sometimes it keeps
the area I have chosen & other times it doesn't - so I wanted to be sure it
posted to the correct area. They should have a way for us to delete our
questions if we feel we made a mistake.

Shomad said:
tina said:
Donna, please don't multi-post (the same question separately to different
newsgroups). Your question was already answered in .queries newsgroup before
Rick got to it here. if you had cross-posted, or preferrably posted to one
newsgroup only, he could have saved himself the trouble.


Rick Brandt said:
I have a field in a query as follows:

GCRS: IIf(Len([combined]>3),Right([combined],3),"")

When I run the query I get #Error all the way down the query. What
am
I
doing wrong?

What I'm trying to get is if the field [combined] has more than 3 characters
in it, I want the field GCRS to display the last 3 characters of the
[combined] field, or else just be blank

Your syntax is wrong. The closing ) on the Len() function needs to be before the
operator.
 
please see the reply I posted to "Shomad". THere should be a way for us to
delete our own questions before answeres are posted, if we feel we made a
mistake or if we finally figured it out on our own.

tina said:
Donna, please don't multi-post (the same question separately to different
newsgroups). Your question was already answered in .queries newsgroup before
Rick got to it here. if you had cross-posted, or preferrably posted to one
newsgroup only, he could have saved himself the trouble.


Rick Brandt said:
Donna said:
I have a field in a query as follows:

GCRS: IIf(Len([combined]>3),Right([combined],3),"")

When I run the query I get #Error all the way down the query. What am I
doing wrong?

What I'm trying to get is if the field [combined] has more than 3 characters
in it, I want the field GCRS to display the last 3 characters of the
[combined] field, or else just be blank

Your syntax is wrong. The closing ) on the Len() function needs to be before the
operator.
 
the simple solution is for you to post an immediate "reply" to your own
post, with "SOLVED" in the subject line, or "Sorry - posted to another
newsgroup", etc. people would appreciate the courtesy.


Donna said:
The only reason I posted it twice was because the first time I had chosen the
area "Query" and didn't notice that it changed back to the default of
Import/Export Data when I went to type the new question. Sometimes it keeps
the area I have chosen & other times it doesn't - so I wanted to be sure it
posted to the correct area. They should have a way for us to delete our
questions if we feel we made a mistake.

Shomad said:
tina said:
Donna, please don't multi-post (the same question separately to different
newsgroups). Your question was already answered in .queries newsgroup before
Rick got to it here. if you had cross-posted, or preferrably posted to one
newsgroup only, he could have saved himself the trouble.


I have a field in a query as follows:

GCRS: IIf(Len([combined]>3),Right([combined],3),"")

When I run the query I get #Error all the way down the query.
What
am
I
doing wrong?

What I'm trying to get is if the field [combined] has more than 3
characters
in it, I want the field GCRS to display the last 3 characters of the
[combined] field, or else just be blank

Your syntax is wrong. The closing ) on the Len() function needs to be
before the
operator.
 
Donna said:
I have a field in a query as follows:

GCRS: IIf(Len([combined]>3),Right([combined],3),"")

When I run the query I get #Error all the way down the query. What am I
doing wrong?

What I'm trying to get is if the field [combined] has more than 3 characters
in it, I want the field GCRS to display the last 3 characters of the
[combined] field, or else just be blank
 
Back
Top