I have a table Tbl_Computron. I would like to auto update the field "Business Units" in the table based on a condition being met in the "Account Hierarchy" field, with the following syntax: IIf([Account Hierarchy] Like "CEAA*","Investment Grade Capital Markets") The thing is, I have over five hundred codes that includes other series such as CEAA, CERB, CEFV etc. and that will have a different business unit other than "Investment Grade Capital Markets". How do I begin to write an iif or else code that will group this for me?
Like, if account hierarchy begins with the prefixes CEFT.... or CGHY or CVRT or CBTY, then Business units is "x'. Then when the series change, Business units will be something else.
3 2630
The Select statement is similar to an If statement. Sometimes however, you can write formulas that are clear and less repetitive using the Select statement. This example evaluates the {Customer.Fax} field to determine if the area code is for Washington state (206, 360, 509) or British Columbia, Canada (604, 250):
'''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''
Select Case Left ({Customer.Fax}, 3)
Case "604", "250"
formula = "BC"
Case "206", "509", "360"
formula = "WA"
End Select
'''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''
The expression right after the Select Case keywords is called the Select condition. In the above example it is Left ({Customer.Fax}[1 To 3]). The Select statement tries to find the first Case that matches the Select condition, and then executes the statements following it, up until the next Case.
This is only an example.
try to study it...........
hope it helps.....................
god bless.................
:)
The Select statement is similar to an If statement. Sometimes however, you can write formulas that are clear and less repetitive using the Select statement. This example evaluates the {Customer.Fax} field to determine if the area code is for Washington state (206, 360, 509) or British Columbia, Canada (604, 250):
'''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''
Select Case Left ({Customer.Fax}, 3)
Case "604", "250"
formula = "BC"
Case "206", "509", "360"
formula = "WA"
End Select
'''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''
The expression right after the Select Case keywords is called the Select condition. In the above example it is Left ({Customer.Fax}[1 To 3]). The Select statement tries to find the first Case that matches the Select condition, and then executes the statements following it, up until the next Case.
This is only an example.
try to study it...........
hope it helps.....................
god bless.................
:)
lilh0ney05
Thanks, works like a charm
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Brittany |
last post by:
can someone explain to me what if else staments do and what while statements
do.
|
by: dmbkiwi |
last post by:
I am new to this group, and relatively new to python programming, however,
have encountered a problem I just cannot solve through reading the
documentation, and searching this group on google.
I...
|
by: Diez B. Roggisch |
last post by:
Hi,
today I rummaged through the language spec to see whats in the for ... else:
for me. I was sort of disappointed to learn that the else clauses simply
gets executed after the loop-body -...
|
by: Bart Nessux |
last post by:
Should an if statement have a corresponding else statement? Or, is it OK
to have an if statement by itself. For completeness, it seems the two
should be together, but from experience I know that a...
|
by: Ron Adam |
last post by:
There seems to be a fair amount of discussion concerning flow control
enhancements lately. with, do and dowhile, case, etc... So here's my
flow control suggestion. ;-)
It occurred to me (a...
|
by: Patrice |
last post by:
Hi,
I need to do multi-conditional statements like below, but this error is
displayed :
Expected 'End'
/myFilepath, line x
else response.write(arrCorpo(sparam,sdiv)) end if
I don't...
|
by: Amy |
last post by:
Hi,
I have 6 If Then Else statements I was supposed to write. I did so but I
know that they have to be wrong because they all look the same. Could
someone take a look at them and point me in the...
|
by: pradeep.thekkottil |
last post by:
I'm setting up an auction website using PHP and MySQL. There in the
section where logged in members can put up new auction in a form, I
want to run a form validation where I used if else statements...
|
by: bearophileHUGS |
last post by:
So far in Python I've almost hated the 'else' of the 'for' loops:
- I have problems to remember its meaning;
- It gives me little problems when I later want to translate Python
code to other...
|
by: Tangleman |
last post by:
I have a schema that defines a programming language for a script that drives a sequentially executing process. It defines the structure of a script that has to interact with a pre-existing,...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
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: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
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: 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
|
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: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
| |