J
jbiggs via AccessMonster.com
I have an update query that is assigning leads to salespeople based on what
percentage of leads are available for each source, that query looks like:
DoCmd.RunSQL "UPDATE clients SET salesperson = " & Text15 & " WHERE ID IN (
SELECT TOP " & NumLeads & " ID FROM clients WHERE Salesperson IS NULL And
[task note] = 'Unworked Lead' And Source = """ & CurrentSource & """) "
The issue is, the leads are assigned randomly and we have a bunch of old
leads backed up in the system. I tried to add ORDER BY [System Date] DESC at
the end of the query but it made things go haywire. Where do I need to add
the ORDER BY statement?
percentage of leads are available for each source, that query looks like:
DoCmd.RunSQL "UPDATE clients SET salesperson = " & Text15 & " WHERE ID IN (
SELECT TOP " & NumLeads & " ID FROM clients WHERE Salesperson IS NULL And
[task note] = 'Unworked Lead' And Source = """ & CurrentSource & """) "
The issue is, the leads are assigned randomly and we have a bunch of old
leads backed up in the system. I tried to add ORDER BY [System Date] DESC at
the end of the query but it made things go haywire. Where do I need to add
the ORDER BY statement?