The application is my do-it-yourself finances, where I track what on earth I actually do with my salary. My previous experience with databases has been data generation, and now I’m coming to grips with condensing existing data into reports. Please understand I have no financial training, so the words I use may sound funny to those who know what they’re talking about.
I have a table tblJournal with fields including Date, From, To, Amount (and some other fields as well, best described as Why). From and To contain account names to represent my savings account, credit card, investment accounts etc.
I have already created a report which summarises each month’s income and expenses in terms of “why”. The date formatting in the query was borrowed from a query created by a wizard, and I can’t say I understand the expression, which is something like
GROUP BY Year(tblJournal.Date) * 12 + Datepart(“m”, tblJournal.Date) – 1 … and then some date formatting
1. I want to create a query which will tell me cashflow into and out of each account, on a monthly basis. I will use this for both a summary and also to retrieve just a single months data.
2. I then want to make that query flexible (monthly, yearly including calendar, financial and specified years).
3. Once I understand the above strange date expression, I want to do the same to my existing expense report.
As yet there is not a table of account names, but this will be trivial to create. From the table structure above, you can see that cash flow out is when the account is listed in the From field, and cash flow into an account when it is listed in the To field. I have queries that will give me either cash flow in or cashflow out, but haven’t worked out how to combine the two.
I guess that a crosstab is looking good here perhaps pivoting on account names, but I’m in unfamiliar territory, and suggestions on how to proceed are most welcome.
Thanks