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  

An IIF statement for a single character(s) Only



 
 
Thread Tools Display Modes
  #11  
Old February 18th, 2007, 10:19 PM posted to microsoft.public.access.queries
John T Ingato
external usenet poster
 
Posts: 52
Default An IIF statement for a single character(s) Only

Remember that and IIf statement has three parts: logical test, True and
False
You can test one logical test and if it is false, you can embed another IIf
statement in the false section...

IIf ( [Field] = ":", True Statement, False statement) or defined further
IIf ( [Field] = ":", 1, FalseStatement) or define further
IIf ( [Field] = ":", 1, IIf ( [Field] = "W", 1, IIf ( [Field] = ":W", 1, IIf
( [Field]="W:", 1, 0) ) ) ) This would give you the 4 possible combinations
of : & W

"sdg8481" wrote in message
...
Hi please help,

In a field i have variuos characters that represents orders, there is an
indefinative number of combinations, all along the following lines;

W:WY
W:W
W:YY
W:WG
W:QGWY
:WW
:YWQ
etc...with a hundred possible options including an unlimited number of
characters.

However, basically all i want is a simple IIF statement, whereby if the
field only contains a ':' or/and 'W' character then put a 1, otherwise put
a
0.

For example,
if the field contains W:WW, then i want a 1 to appear
If the field contains WWY, then i want a 0 to appear

I hope this makes sense.

Thanks





 




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:43 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.