Finance

How to Split Transactions in GNUCash Using SQL: Step-by-Step Guide

If you use GNUCash for your personal accounts you may decide that you want to split out a particular group of transactions into a new account or a subaccount in your expenses.

Unfortunately there is no easy way to achieve this in the GUI and so you can either sit there manually clicking and changing them by hand or you can resort to using a bit of SQL to do the work for you.

First, it is likely you are using the default file format which is compressed XML, so the first step is to save a copy in the SQLite format. Don’t delete your old file though, just in case you royally mess things up.

Next step, download a copy of DB Browser for SQLite and install this on your machine, then open the file you just saved.

Navigate to the ‘Browse Data’ tab and look at the ‘accounts’ table, here you will see a list of all your accounts. You want to find the ‘guid’ of the account where your transactions currently live and also the one you want to transfer them to.

Next you want to go to the ‘Execute SQL’ tab and use the query below as an example. This will move any transactions in the old account with a description containing ‘Student Loan Payment’ into the new account.

You may want to test just the SELECT portion of this first before the update to ensure it returns all the items you expect and only those items.

UPDATE splits
SET account_guid = 'GUID OF NEW ACCOUNT'
WHERE 
    tx_guid IN (
        SELECT 
            t.guid
        FROM
            transactions AS t
        JOIN
            splits ON t.guid = splits.tx_guid
        WHERE 
            t.description LIKE '%Student Loan Payment%'
            AND splits.account_guid = 'GUID OF OLD ACCOUNT' 
    );
AND
	account_guid = 'GUID OF OLD ACCOUNT'
Health

Blood test detects melanoma skin cancer while it’s easily treatable

Recently read an article on New Scientist about trails of a new blood test that detects melanoma skin cancer while it’s still in the early stages.

As someone who has had skin cancer I think this a great discovery and hopefully will be able to detect these problems earlier so that people do not have the same issue that I did with regards to being misdiagnosed. Originally the first consultant I saw said that my mole that had changed was nothing to worry about, it wasn’t until 9 months later after it had changed more and I had forced my GP to refer me again was it finally diagnosed as melanoma and dealt with.

I would hope in the future that someone in the same situation could take this blood test to see if the anti-bodies exist and have the problem dealt with much earlier and avoid misdiagnosis in early stages of the disease.

Politics

Banning diesel and petrol cars from 2040

In 1994 your phone would have looked like this.

If someone had told you that in 23 years time your phone would:
• Be thinner than a pencil
• Be 1000x more powerful than your 486 computer
• Able to instantly play music from over a million CD’s
• Play videos at 24x the resolution of a VHS tape
• Allow you access to more data than the encyclopaedia Britannica at the touch of a button

You would have said it’s not possible, that things don’t move that quickly?

Why are some people thinking it’s so crazy we’ll all be driving electric cars by 2040??

DIY

Replacing Honeywell ST7100 with Nest Thermostat

Today I finally got around to fitting my Nest 3rd gen thermostat, ran into a few issues with the wiring as I was under the assumption that it was clever enough to not need the wires to the common connections for the central heating and hot water if they were the same as the main live, which they were on my original Honeywell setup.

Turned out after wiring it all in that indeed, you do need to jumper connect from live to each of the commons, at least in my case. After figuring this out I think my system represents the Y plan setup in the diagrams.

n case someone else plans to replace a Honeywell ST7100 with a Nest thermostat you need to wire it as follows:

  • Any spare lives (I had two) into a connector strip and ignore
  • Main live goes to L on the nest
  • Neutral, I had three wires going into this so fed them into connector strip then a single wire from there to the N on the Nest
  • 8 on ST7100 goes to 6 on the Nest
  • 7 on ST7100 goes to 4 on the Nest
  • 5 on ST7100 goes to 3 on the Nest
  • Then the missing step I had, link L to 2 and 2 to 5

One thing I have discovered is that whilst the Honeywell seemed to give preference to hot water if both heating and hot water are requested, the Nest seems to give preference to heating. This lead to a lack of hot water on the first few days, but now I have just changed the schedule to be at times when the heating is not on.

Allotment

Poly tunnel Raised Beds

Poly tunnel raised beds
Poly tunnel raised beds

 

Today I built the raised beds for our poly tunnel, these were made of scaffolding boards and bolted together with M10 x 120mm coach screws from UK Fixings in Sheffield. The coach screws required 7mm pilot holes to ensure that they did not split the scaffold boards, after that they were pretty easy to put together.

On the left hand side we have beds spanning the full length of approx 6m, in the centre and right they span about 4m in length and we plan to build a small potting station in the right hand corner where we can start off some of our plants and possibly grow a few herbs.

Now the next job is to fill all the beds with manure and soil, and then get planting a ton of vegetables!

Politics

Greens oppose neonicotinoids

The Bassetlaw Green Party is opposed to current plans to ignore the European Food Safety Authority (EFSA) recommendation to ban neonicotinoids. British Environment Secretary, Owen Patterson, has already indicated that the Government is likely to ignore the EFSA who said the chemicals “pose a number of risks to bee health”.

Neonicotinoids are a type of insecticide used to control pests on farmland crops, unfortunately there has been increasing studies showing that this is leading to a drastic reduction in bee populations.

The Government should be representing it’s people as a whole and not its vested interests in mega corporations. Concern about bee populations may seem ‘hippy’ but without bees we will cause bigger crop problems in the country than the pests these chemicals are designed to stop.

As someone with an allotment I deeply appreciate the job that bees and other pollinating insects provide to us. All too often we forget the intricate balance of the ecosystem that has evolved over the millions of years that the Earth has existed, we cannot just continue to plague the planet like the insects these farmers are trying to kill.

Health

First blood donation of the year

Done my first blood donation of the year today!

The only problem with improving your health is that it seems to take longer to fill the bag when your resting heart rate is low and you have donated blood enough times that it no longer bothers you too much. Blagged myself a packet of crisps and a biscuit whilst having a drink after donating, bit of a quick lunch before heading back to the office.

Anyway hopefully it will save a life or two, I highly encourage others to take 30 mins of their time to go and donate blood if they are healthy enough to do so.

NBS0778-Adult-Masthead_4

Politics

Joined the Green Party

Today I have joined the Green Party as I have had enough of just ranting online, signing petitions and pestering my MP. It’s time to take some real action in sorting out this mess we’ve got this country in to!

There are many groups that I am a big advocate of which align with the Green Party’s policies such as the Open Rights Group and Positive Money. I really don’t think this country can continue down it’s current path any more.

We are continually seeing scandals in the newspapers, the Government continually ignoring advice from scientific research and just blatantly ignoring its populace as a whole. This just can’t continue, we are supposed to have a democracy but it seems our Government is mostly there just to benefit businesses and those that are stinking rich.

I am going to do my best to get a local Green Party up and running in Bassetlaw and ensure we have a candidate for the General Election, even if it ends up being me standing!

Allotment

Winter harvest

10882111_10101392279210098_3875173840084149448_nBeen to the allotment today and done a bit of a winter harvest and to grab a few things ready for Christmas. Grabbed several leeks, some radishes, white beetroot and various leafy greens. All in all a pretty nice selection of veg for the winter, shame the temperature is likely to plummet soon.

Pretty happy with what we’ve accomplished on our allotment this year, hopefully next year will bring us closer to being less reliant on shopping at the supermarket.

Allotment

Polytunnel Complete

Polytunnel complete
Polytunnel complete

Today we managed to put the cover on the polytunnel with the help of James and David. First I built a bit of supporting framework on the inside out of 100mm x 100mm fence posts, we have three posts going vertically and then two going horizontally with a lap joint in the middle.

The timber will help give the polytunnel more stability in the wind and also will give us something to attach netting to and maybe some hanging baskets.

Next step will be to build some raised beds inside, but that will likely be done in the new year as there isn’t much point doing it now with winter rolling in.