Search results

  1. A

    SQL Order By With Calculations

    I am trying to import data from my database. My current SQL is as follows: SELECT DISTINCT (rep.lastname+', '+rep.firstname) AS Rep, (SELECT COUNT(*) FROM LiveData WHERE WorkingRep = tli.WorkingRep) AS Worked, (SELECT COUNT(*) FROM LiveData WHERE SuccessType = 'PTP' AND WorkingRep =...
  2. A

    Access SQL TOP n ORDER BY issue

    I have a a table with primary key being [Account Number]. I am trying to order all my accounts by their priority and then return the next account to be worked (the top account). i use the sql like: SELECT TOP 1 [Account Number] FROM LiveData WHERE WorkingRep Is Null ORDER BY Priority ASC...
  3. A

    Allow Opening of one single record at a time.

    Here is my vba code: strSQL = "SELECT TOP 1 [Account Number] FROM LiveData WHERE WorkingRep Is Null And Priority In (1);" Set rst1 = New ADODB.Recordset With rst1 Debug.Print .State .Open strSQL, CurrentProject.Connection, adOpenForwardOnly, adLockOptimistic Debug.Print .State...
Back
Top Bottom