Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recent content by mordja

  1. mordja

    Select Top 5 For Each Group By Value

    PHV, Thanks, that works. Although if there are several cusips with the same balance then the top five will return five balances but possibly more than five cusips. Mordja
  2. mordja

    Select Top 5 For Each Group By Value

    PHV, Apologies, my last real SQL attempt is [code] SELECT A.countryOfIssue, A.Cusip, Sum(A.BorrowBalance) AS SumOfBorrowBalance FROM Borrows_quniAll AS A, (SELECT TOP 5 C.countryOfIssue, C.cusip, Sum(C.BorrowBalance) AS SumOfBorrowBalance FROM Borrows_quniAll AS C GROUP BY C.countryOfIssue...
  3. mordja

    Select Top 5 For Each Group By Value

    PHV, You asked I replied And As to the REAL sql I have tried as I said I kept trying a lot of different things including all the response that I received. The above is the only REAL attempt that I had saved before I became frustrated and resorted to VBA. Im not try to be difficult or...
  4. mordja

    Select Top 5 For Each Group By Value

    PHV, I tried a lot of different things but could only get the Top 5 records back as opposed to the numberOfCurrency * 5. SELECT TOP 5 A.currency, A.cusip, Sum(A.BorrowBalance) AS SumOfBorrowBalance FROM Borrows_quniAll AS A, (Select Distinct currencyfrom Borrows_quniAll) as B Where...
  5. mordja

    Select Top 5 For Each Group By Value

    PHV, That will prompt me for the currency and will only result in the top 5 for a singular currency, I want the top five cusips by balance for each currency. Currency Cusip Balance AUL AX0903 19000000 AUL AX1203 17500000 AUL AX4203 11000000 AUL AX0303 9000000...
  6. mordja

    Select Top 5 For Each Group By Value

    NorthNone, What I had only brought back the top five overall, I want the top five per currency, with 30 currencys that makes 150 rows returned. DotNetGnat, Tried that but it didnt work, A.Currency is not recognised in the second select statement prompting me for a value. Ive written a vba...
  7. mordja

    Select Top 5 For Each Group By Value

    Hi, I have three fields: Currency, Cusip and Balance. I group by Currency and Cusip and sum the balance. I want to select the top 5 cusips and their respective balances per currency. Can you do several Top 5's in the one sql statement without having to do a union and a whole lot of select...
  8. mordja

    What resets the Error object ??

    dmksas, Hey thanks should have realised, and as to why Ive used select * from etc, never really thought about it, i will use rst.Open strLogTable from now on ! Mordja
  9. mordja

    What resets the Error object ??

    Hi, Ive written a simple module which I now use to log any errors that any event may trigger. Option Compare Database 'Provides simple error logging facilities Public Const strLogTable As String = "tblErrorLog" Public Function logError(ByVal strObjectSource As String, ByVal intErrorNumber...
  10. mordja

    Creating A User Log

    Apologies, Ok, any ideas as to why my hostname is logged in three times, twice as my username and once as admin ? Also where can more information about the available schemas be found ? VBACT, Shiftkey, if the property exists then CurrentDb.Properties("AllowBypassKey") = False if not...
  11. mordja

    Creating A User Log

    Ok, any ideas as to why my hostname is logged in three times, twice as my username and once as admin ? Also where can more information about the available schemas ? Thanks Mordja
  12. mordja

    Creating A User Log

    FancyPrairie, I tried your test function and all fields were printed. The only difference was that I was trying to pring them on the one line and for a reason unknown to me, maybe you can explain, only rst.Fields(0) printed out. MsgBox rst.Fields(0).Value & " " & rst.Fields(1).Value & " " &...
  13. mordja

    Creating A User Log

    FancyPrairie, I ran your module but for some reason it only returned the Computer name, the other three fields were blank ? When calling the function from within the VBE it returns my Computer name twice, does it count me as being logged in twice because I am in the VBE and the database ...
  14. mordja

    Creating A User Log

    earthandfire, True, but from an admin perspective If I want to be able to check who has logged in and when that does not help. Is there another way that I could do this ? Is there anyway to tell if and when access closed abnormally? Thanks Mordja
  15. mordja

    Creating A User Log

    Hi, I have created a user log by adding the users system ID to a table when they log in and deleting when they log out. The code that I used for the user ID is This code was originally written by Dev Ashish. ' It is not to be altered or distributed, ' except as part of an application. ' You...

Part and Inventory Search

Back
Top