Search results

  1. J

    Counting Transactions

    Problem solved. Kempes, thank you very much for your help. Your code works perfectly. Best regards, JapanFreak
  2. J

    Weighted Averages in sub-query...

    Problem solved. Pete, thank you so much for your help. Both alternatives work. Actually, it took some time until I fully understood what you are doing in the first one. It contains several things I did not know before. Thank you for helping me to learn that stuff. Once again thank you very...
  3. J

    Weighted Averages in sub-query...

    Clarification Hi, thank you for your reply. No, there is nothing missing, it depends on whether Quantity is >0 or <0: Best regards, JapanFreak
  4. J

    Weighted Averages in sub-query...

    Hi there, once again I have a problem for which I am looking for some hints... I still have one table, called tblTransactions, which contains security market transactions. For each buy and sell order, respectively it contains one data set with columns Date, Ticker (i.e. the unique identifier...
  5. J

    Counting Transactions

    Not yet there: Problem with DCount Hi again, thank you very much for your reply. Actually, I did not know the DCount function before. I have adjusted the SQL query as follows: SELECT T.Ticker, DCount("Quantity","tblTransactions","Date<=#1/20/2007#") AS NumberOfTrades FROM tblTransactions AS...
  6. J

    Counting Transactions

    Hi there, I have one table, called tblTransactions, which contains records on security market transactions. For each buy and sell order, respectively it contains one dataset with columns Date, Ticker (i.e. the unique identifier of each security), Quantity (positive for buy, negative for sell...
  7. J

    Improper SQL query?

    Problem solved. Hi there, I finally found the solution by including a WHERE condition in ByteMyzer's code: SELECT T.Ticker, S.Name, Sum(T.Qty) AS TotQty, Q.qCl, T3.qStop FROM ((tblTransactions AS T INNER JOIN tblQuotes AS Q ON T.Ticker=Q.qTicker) INNER JOIN tblTradedSecurities AS S ON...
  8. J

    Improper SQL query?

    My objective I am sorry... The attachment above does also contain a query called qryPortfolioHoldingsWithStops. It is based on the following SQL code: SELECT T.Ticker, sum(T.Qty) AS SumOfQuantity, (SELECT Top 1 [qStop] FROM [tblStops] WHERE [Date]<=#3/09/2007# AND T.Ticker=tblStops.Ticker...
  9. J

    Improper SQL query?

    Not yet there... Thank you very much for your contribution. Some background re my problem: - tblTransactions contains security transactions: Date of the transaction, ticker (the identifier of a stock), number of stocks traded (Qty), price (Entry) - tblTradedSecurities contains information of...
  10. J

    Improper SQL query?

    Sample attached Hi Keith, thank you very much for your help, I really appreciate that. Attached please find the database with some sample data. I have already changed some field names so that I do not use reserved words like “Stop” any longer. However, it still does not work. The problem...
  11. J

    Improper SQL query?

    Keith, thank you very much for your reply. I made the changes you suggested, however unfortunately it still does not work and the error message remains the same. Regarding the subquery: I used a "Top 1"-query because tblStopps does not contain data for each and every date but only for dates...
  12. J

    Improper SQL query?

    Hi there, I have a problem with an SQL query, which should combine data out of three different tables (tblTransactions, tblTradedSecurities, tblStopps, tblQuotes) using a combination of Inner-joins and sub-queries. However, I get an error message, which tells me that this is an improper SQL...
  13. J

    Creating Time Series for Portfolio Values

    Problem Solved Hi, thank you very much for your help! This is really the best forum of the world. Best regards, JapanFreak
  14. J

    Creating Time Series for Portfolio Values

    Bilbo_Baggins_Esq, I am of course more than happy to upload an example. The attachment contains the two tables tblTransactions and tblQuotes (the latter one is updated via internet using a free tool called Quaccess -> www.quaccess.com), i.e. the structure of the latter table must not be...
  15. J

    Creating Time Series for Portfolio Values

    Dear All, once again I need your help, I have no idea how to tackle the following problem. I am taking records of stock market transactions. As a final result I want to have a query which gives me for every end of the day the total value of my portfolio. Therefore I have two tables. The first...
  16. J

    Problem with GROUP BY [Date Time]

    Problem solved Thank you very much for your posts. Yes, I apology, I was such a stupid mistake. After formatting correctly it eventually worked. Best regards JapanFreak
  17. J

    Problem with GROUP BY [Date Time]

    Does not work... Hi there, thank you very much for your help. Unfortunately, this code still does not work. I get an error message, which says (I have to translate a German error message) that the criteria types in the criteria expression are incompatible (I hope you know what I mean)... What...
  18. J

    Problem with GROUP BY [Date Time]

    Hi there, I have a table called tblTransactions with columns called (among others) [Date Time], Ticker, Quantity, Price and Commission. Column [Date Time] contains both a date and a time. I want to determine the commission paid per day. If I use the following code I still get all single trades...
  19. J

    Problem with Sub-Query

    Problem solved, one additional question Thank you very much, this query works. However, I have one additional question. How can I use fields, which I have created with a sub-query? That is, with the above query I have all traded Tickers with the date, when the position in each particular...
  20. J

    Problem with Sub-Query

    Not 100% clear... Hi, thank you very much for your reply. I used now HAVING instead of WHERE, but Access still asks me to include sth in the GROUP BY part... but what? Date does not work, but what else?? SELECT T.Ticker, (SELECT Top 1 [Date] FROM [tblTransactions] HAVING sum(T.Quantity)=0...
Back
Top Bottom