Is there a way to sort credit before debit for the same day? It seems the order is by time of entry, I understand that I can cheating it by entering credit first, but sometimes it's not possible, so if it's possible to sort it this way will be very helpful.

  • 1
    (I'm a "database guy", not a gnucash user.) Are there separate "date" and "time" columns, or is there a single "date/time" column. If two columns, then technically it would be possible to sort by date/type/time. However, if there's only one "date/time" column, then there's no way (technically, there is, but it's a lot of work) to sort by date/type/time, since there's no separate "date" and "time" fields.
    – RonJohn
    Commented Mar 18, 2021 at 10:43
  • @RonJohn, I'm afraid there's none, only date, no time. I'll try to add as a feature request.
    – michaelbr
    Commented Mar 18, 2021 at 10:52
  • Ah, I see what you mean by "time of entry". There must be an internal sequence number.
    – RonJohn
    Commented Mar 18, 2021 at 10:54
  • @RonJohn, yes, there must be, but I'm not that knowledgeable about Linux/coding, so no idea where it is, I guess I'll just leave it for now.
    – michaelbr
    Commented Mar 21, 2021 at 10:37

2 Answers 2


GnuCash primarily sorts transactions in the register by the date of the transaction. In the absence of transaction numbers, or any other data used for sorting, then multiple transactions for the same day are sorted according to the order in which they were entered.

However, you can force multiple transactions for the same day to appear in a particular order in your register by simply giving each transaction a transaction number as well as a date.

If you are still making payments by cheque, then you will probably want to keep the actual cheque number as the reference for those transactions. If you want another transaction to appear before (or after) the cheque transaction, then just use a lower (or higher) value in the number field for the second transaction. Feel free to make up a suitable number - GnuCash doesn't mind, except it may suggest a "next in sequence" number that you will need to override the next time you record a cheque transaction

  • it's not the same type of transaction, it can be a debit from expenses and then a credit from a transfer, if it's the same type of transaction, I think it'll be much simpler. In this case, where do I set the reference number? Besides, doing it manually for each transaction is time consuming, would be nice to have a feature to sort it out automatically.
    – michaelbr
    Commented May 29, 2021 at 12:21
  • @michaelbr You set the reference numbers in the "Num" fields of the register where you want to reorder the transactions. It doesn't need to be overly time consuming, because you don't need to set a transaction number for EVERY transaction, just those transactions where you explicitly want to change the order from the way that GnuCash initially sorted them. You can do this retrospectively, and only in cases where the automatic ordering is causing you concern. Commented May 30, 2021 at 3:22

I assume you're asking because you don't like to see asset accounts temporarily going negative on a single day, which doesn't reflect reality. I find this annoying as well.

AFAIK there is no option to sort credits before debits. I believe you're correct that GnuCash sorts transactions by the time they are created (not modified). So, if you have just a few you want to fix, you can duplicate the transaction for any particular debit, and then delete the original one. This will change the create time of that transaction to now, and then it will display at the end of the day.

I'll admit I do that fixup every once in a while, but mostly I've just come to accept seeing negative numbers sometimes and I don't really worry about it, unless it stays negative for more than 1 day (which could potentially incur overdraft fees).

As a maddening side note, 15 years ago a friend of mine got charged three $35 overdraft fees by her bank in the same day because she had about $500 in her account and used her debit card for gas, then milk and a loaf of bread at White Hen, and then paid her cell phone bill, all of which totaled about $100. But her mortgage payment of $800 came through later that same day and was sorted to be first because as the bank customer support explained, "The mortgage payment is more important and we don't want it to bounce." They were nice enough to fix it because we asked, but who knows how many people they did this to that never noticed or complained.

  • that's one of the reasons, another related reason is I came from Windows, when I was using Quicken in Windows, it's by default that credit came before debit for the same day, even if it's entered at a later date, in a enduser point of view, it seems to me that this is a better way, so when there's a negative/red, it should call your attention right away (and not be alarmed by "false negative").
    – michaelbr
    Commented Mar 21, 2021 at 10:43
  • @michaelbr I agree. It sure would be nice if there was simply an option for it.
    – TTT
    Commented Mar 21, 2021 at 13:51
  • @michaelbr the "correct" sorting order, it seems to me, is the one that the banks use. That way, your computer account reflects what the bank thinks it is. (A mitigation, of course, is to know when your bills are due, and ensure that you have enough money to cover them.)
    – RonJohn
    Commented Mar 21, 2021 at 14:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .