How do I group customers into one name or number?

  • Thread starter Thread starter Mario
  • Start date Start date
M

Mario

I need to use an if statement for 9 customers that are assigned numbers, is
there a way I can name them only once so I don't have to do the if statement
9 times?
 
I do not fully understand but this might help.
IIF(Val([YourField]) >0, "Say something", [YourField])
 
Here is a sample of what I need:

If [CustomerID]=1705 and 0939 and 0941 and 1338 and 1290 and 1549 and 1351
and 1398 and 1680 then
..........

How can I put this nine customers into one group so I don't have to do nine
if statements (keeping in mind that I have 400 customers)?

KARL DEWEY said:
I do not fully understand but this might help.
IIF(Val([YourField]) >0, "Say something", [YourField])
--
KARL DEWEY
Build a little - Test a little


Mario said:
I need to use an if statement for 9 customers that are assigned numbers, is
there a way I can name them only once so I don't have to do the if statement
9 times?
 
Your syntax is wrong. It would be like this --
IIf [CustomerID]=1705 OR [CustomerID]= 0939 OR [CustomerID]= 0941 OR
[CustomerID]= 1338 OR [CustomerID]= 1290 OR [CustomerID]= 1549 OR
[CustomerID]= 1351 OR [CustomerID]= 1398 OR [CustomerID]= 1680, "Something",
"Other Thing")

I think that it would be better to use a translation table laid out like
this --
[Group] [CustomerID]
2 1705
2 0939
2 0941
2 1338
3 1290
3 1549
4 1351
5 1398
6 1680
In you query left join your table to the translation table on the
[CustomerID] field.
The group field can be anything you need - Dept#, Position Title, Salary,
etc - or a field for each of these.

--
KARL DEWEY
Build a little - Test a little


Mario said:
Here is a sample of what I need:

If [CustomerID]=1705 and 0939 and 0941 and 1338 and 1290 and 1549 and 1351
and 1398 and 1680 then
.........

How can I put this nine customers into one group so I don't have to do nine
if statements (keeping in mind that I have 400 customers)?

KARL DEWEY said:
I do not fully understand but this might help.
IIF(Val([YourField]) >0, "Say something", [YourField])
--
KARL DEWEY
Build a little - Test a little


Mario said:
I need to use an if statement for 9 customers that are assigned numbers, is
there a way I can name them only once so I don't have to do the if statement
9 times?
 
Thank you for your help, I thought there was an easier way of doing it,
something like:

[SampleField]=[CustomerID]=1705 OR [CustomerID]= 0939 OR [CustomerID]= 0941
OR [CustomerID]= 1338 OR [CustomerID]= 1290 OR [CustomerID]= 1549 OR
[CustomerID]= 1351 OR [CustomerID]= 1398 OR [CustomerID]= 1680

If [CustomerID]=[SampleField] then
.............

KARL DEWEY said:
Your syntax is wrong. It would be like this --
IIf [CustomerID]=1705 OR [CustomerID]= 0939 OR [CustomerID]= 0941 OR
[CustomerID]= 1338 OR [CustomerID]= 1290 OR [CustomerID]= 1549 OR
[CustomerID]= 1351 OR [CustomerID]= 1398 OR [CustomerID]= 1680, "Something",
"Other Thing")

I think that it would be better to use a translation table laid out like
this --
[Group] [CustomerID]
2 1705
2 0939
2 0941
2 1338
3 1290
3 1549
4 1351
5 1398
6 1680
In you query left join your table to the translation table on the
[CustomerID] field.
The group field can be anything you need - Dept#, Position Title, Salary,
etc - or a field for each of these.

--
KARL DEWEY
Build a little - Test a little


Mario said:
Here is a sample of what I need:

If [CustomerID]=1705 and 0939 and 0941 and 1338 and 1290 and 1549 and 1351
and 1398 and 1680 then
.........

How can I put this nine customers into one group so I don't have to do nine
if statements (keeping in mind that I have 400 customers)?

KARL DEWEY said:
I do not fully understand but this might help.
IIF(Val([YourField]) >0, "Say something", [YourField])
--
KARL DEWEY
Build a little - Test a little


:

I need to use an if statement for 9 customers that are assigned numbers, is
there a way I can name them only once so I don't have to do the if statement
9 times?
 
You need to do some reading on syntax. You have to separate actions with
parenthsis.

[SampleField]=[CustomerID]=1705 OR [CustomerID]= 0939 ... will not work
anywhere.
--
KARL DEWEY
Build a little - Test a little


Mario said:
Thank you for your help, I thought there was an easier way of doing it,
something like:

[SampleField]=[CustomerID]=1705 OR [CustomerID]= 0939 OR [CustomerID]= 0941
OR [CustomerID]= 1338 OR [CustomerID]= 1290 OR [CustomerID]= 1549 OR
[CustomerID]= 1351 OR [CustomerID]= 1398 OR [CustomerID]= 1680

If [CustomerID]=[SampleField] then
............

KARL DEWEY said:
Your syntax is wrong. It would be like this --
IIf [CustomerID]=1705 OR [CustomerID]= 0939 OR [CustomerID]= 0941 OR
[CustomerID]= 1338 OR [CustomerID]= 1290 OR [CustomerID]= 1549 OR
[CustomerID]= 1351 OR [CustomerID]= 1398 OR [CustomerID]= 1680, "Something",
"Other Thing")

I think that it would be better to use a translation table laid out like
this --
[Group] [CustomerID]
2 1705
2 0939
2 0941
2 1338
3 1290
3 1549
4 1351
5 1398
6 1680
In you query left join your table to the translation table on the
[CustomerID] field.
The group field can be anything you need - Dept#, Position Title, Salary,
etc - or a field for each of these.

--
KARL DEWEY
Build a little - Test a little


Mario said:
Here is a sample of what I need:

If [CustomerID]=1705 and 0939 and 0941 and 1338 and 1290 and 1549 and 1351
and 1398 and 1680 then
.........

How can I put this nine customers into one group so I don't have to do nine
if statements (keeping in mind that I have 400 customers)?

:

I do not fully understand but this might help.
IIF(Val([YourField]) >0, "Say something", [YourField])
--
KARL DEWEY
Build a little - Test a little


:

I need to use an if statement for 9 customers that are assigned numbers, is
there a way I can name them only once so I don't have to do the if statement
9 times?
 
Thank you for your time Karl.

Is there anybody else that can help me?

KARL DEWEY said:
You need to do some reading on syntax. You have to separate actions with
parenthsis.

[SampleField]=[CustomerID]=1705 OR [CustomerID]= 0939 ... will not work
anywhere.
--
KARL DEWEY
Build a little - Test a little


Mario said:
Thank you for your help, I thought there was an easier way of doing it,
something like:

[SampleField]=[CustomerID]=1705 OR [CustomerID]= 0939 OR [CustomerID]= 0941
OR [CustomerID]= 1338 OR [CustomerID]= 1290 OR [CustomerID]= 1549 OR
[CustomerID]= 1351 OR [CustomerID]= 1398 OR [CustomerID]= 1680

If [CustomerID]=[SampleField] then
............

KARL DEWEY said:
Your syntax is wrong. It would be like this --
IIf [CustomerID]=1705 OR [CustomerID]= 0939 OR [CustomerID]= 0941 OR
[CustomerID]= 1338 OR [CustomerID]= 1290 OR [CustomerID]= 1549 OR
[CustomerID]= 1351 OR [CustomerID]= 1398 OR [CustomerID]= 1680, "Something",
"Other Thing")

I think that it would be better to use a translation table laid out like
this --
[Group] [CustomerID]
2 1705
2 0939
2 0941
2 1338
3 1290
3 1549
4 1351
5 1398
6 1680
In you query left join your table to the translation table on the
[CustomerID] field.
The group field can be anything you need - Dept#, Position Title, Salary,
etc - or a field for each of these.

--
KARL DEWEY
Build a little - Test a little


:

Here is a sample of what I need:

If [CustomerID]=1705 and 0939 and 0941 and 1338 and 1290 and 1549 and 1351
and 1398 and 1680 then
.........

How can I put this nine customers into one group so I don't have to do nine
if statements (keeping in mind that I have 400 customers)?

:

I do not fully understand but this might help.
IIF(Val([YourField]) >0, "Say something", [YourField])
--
KARL DEWEY
Build a little - Test a little


:

I need to use an if statement for 9 customers that are assigned numbers, is
there a way I can name them only once so I don't have to do the if statement
9 times?
 
Back
Top