G
garyusenet
I'm using MS VB Express Ed. 2005.
I have an sql database. This database has one table, and there is a
column called salesman.
I want to AUTOMATICALLY enter the salesman name for every new record
created.
The salesman name will be taken from a list of six possible salesman in
strict order. i.e. salesman one for the first record, salesman two for
the second, etc... until record seven arises, which will be given
salesman one, ad infinitum.
The form will need to have an option to 'skip' a salesman if he is not
available, in which case the salesman ascribed to the record should
then become the next salesman from the list. However for the next
record added, it should revert back to the salesman that was
unavailable.
the whole point is i need to generate a system which allocated incoming
leads to the salesman in a fair impartial manner.
someone suggested the following sql query to me, but it makes no sense
to me - do you think this is what i'd need? and if so can you please
explain it. and how i would enter this in vb express as i have only
used ms access in the past.
===
You need to record the datetime that each salesman do their thing. Use
this
query and pick the one at the top of the list.
SELECT Table26.name AS [Up Next], Last(Table26.leadtime) AS [Last Time]
FROM Table26
GROUP BY Table26.name
ORDER BY Last(Table26.leadtime);
I do not know how you expect to skip the salesman that aren't available
unless you are going to record their not being present as a sales
activity.
=====================
Thankyou very much.
Gary.
I have an sql database. This database has one table, and there is a
column called salesman.
I want to AUTOMATICALLY enter the salesman name for every new record
created.
The salesman name will be taken from a list of six possible salesman in
strict order. i.e. salesman one for the first record, salesman two for
the second, etc... until record seven arises, which will be given
salesman one, ad infinitum.
The form will need to have an option to 'skip' a salesman if he is not
available, in which case the salesman ascribed to the record should
then become the next salesman from the list. However for the next
record added, it should revert back to the salesman that was
unavailable.
the whole point is i need to generate a system which allocated incoming
leads to the salesman in a fair impartial manner.
someone suggested the following sql query to me, but it makes no sense
to me - do you think this is what i'd need? and if so can you please
explain it. and how i would enter this in vb express as i have only
used ms access in the past.
===
You need to record the datetime that each salesman do their thing. Use
this
query and pick the one at the top of the list.
SELECT Table26.name AS [Up Next], Last(Table26.leadtime) AS [Last Time]
FROM Table26
GROUP BY Table26.name
ORDER BY Last(Table26.leadtime);
I do not know how you expect to skip the salesman that aren't available
unless you are going to record their not being present as a sales
activity.
=====================
Thankyou very much.
Gary.