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
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...
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...
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...
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...
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...
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...
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
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...
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...
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
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 & " " &...
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 ...
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
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...
Hi,
I have an access database which is workgroup protected. The default user does not need a password. When the default user attempts to access an ODBC table via VBA access prompts them for their login and password as expected. For the users which enter a password when logging in (amdin...
0212,
Im assuming that you have created a new workgroup file. It sounds like you have set access to always use this workgroup file which will cause any instance of access being opened to request a username and password from the workgroup file.
Go to tools -> database security -> workgroup...
Hi,
I have an access database which is workgroup protected. The default user does not need a password. When the default user attempts to open an ODBC table access prompts them for their login and password as expected. For the users which enter a password when logging in (amdin, desginer...
Eupher,
After further investigation I realised that the error was a result of the join and that the module worked as it should.
And by using the function on above the results I got closer to where I wanted.
SELECT DISTINCT CANCELL.adjustmentId AS CancelID, RECALC.adjustmentId AS RecalcID...
Hi,
I have a query which matches up pairs of Ids from the same table and samefield based on certain criteria. Once a match has been found I can no longer consider those Ids for further pairs. To do this I need to know both of the ids from the prior row.
I have written a module (only stores one...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.