Orders all select queries by ascending date
This commit is contained in:
parent
9198911c5a
commit
ac4e14ca35
@ -1,11 +1,11 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
from decimal import Decimal
|
||||||
import csv
|
import csv
|
||||||
import datetime
|
import datetime
|
||||||
import logging
|
import logging
|
||||||
import logging.config
|
import logging.config
|
||||||
import pathlib
|
import pathlib
|
||||||
import sqlite3
|
import sqlite3
|
||||||
from decimal import Decimal
|
|
||||||
|
|
||||||
from .transactions import Transaction
|
from .transactions import Transaction
|
||||||
|
|
||||||
@ -58,6 +58,7 @@ SELECT COUNT(*), date, description, bank, value
|
|||||||
FROM transactions
|
FROM transactions
|
||||||
GROUP BY date, description, bank, value
|
GROUP BY date, description, bank, value
|
||||||
HAVING COUNT(*) > 1
|
HAVING COUNT(*) > 1
|
||||||
|
ORDER BY date ASC
|
||||||
"""
|
"""
|
||||||
|
|
||||||
SORTED_TRANSACTIONS = """
|
SORTED_TRANSACTIONS = """
|
||||||
@ -77,6 +78,7 @@ SELECT_TRANSACTIONS_BY_CATEGORY = """
|
|||||||
SELECT *
|
SELECT *
|
||||||
FROM transactions
|
FROM transactions
|
||||||
WHERE category IS (?)
|
WHERE category IS (?)
|
||||||
|
ORDER BY date ASC
|
||||||
"""
|
"""
|
||||||
|
|
||||||
SELECT_TRANSACTIONS_BETWEEN_DATES_WITH_CATEGORY = """
|
SELECT_TRANSACTIONS_BETWEEN_DATES_WITH_CATEGORY = """
|
||||||
@ -84,11 +86,13 @@ SELECT *
|
|||||||
FROM transactions
|
FROM transactions
|
||||||
WHERE date BETWEEN (?) AND (?)
|
WHERE date BETWEEN (?) AND (?)
|
||||||
AND category IS (?)
|
AND category IS (?)
|
||||||
|
ORDER BY date ASC
|
||||||
"""
|
"""
|
||||||
|
|
||||||
SELECT_TRANSACTION_BY_PERIOD = """
|
SELECT_TRANSACTION_BY_PERIOD = """
|
||||||
SELECT EXTRACT((?) FROM date) AS (?), date, description, bank, value
|
SELECT EXTRACT((?) FROM date) AS (?), date, description, bank, value
|
||||||
FROM transactions
|
FROM transactions
|
||||||
|
ORDER BY date ASC
|
||||||
"""
|
"""
|
||||||
|
|
||||||
SELECT_TRANSACTIONS_BETWEEN_DATES_WITHOUT_CATEGORIES = """
|
SELECT_TRANSACTIONS_BETWEEN_DATES_WITHOUT_CATEGORIES = """
|
||||||
@ -96,6 +100,7 @@ SELECT *
|
|||||||
FROM transactions
|
FROM transactions
|
||||||
WHERE date BETWEEN (?) AND (?)
|
WHERE date BETWEEN (?) AND (?)
|
||||||
AND category NOT IN {}
|
AND category NOT IN {}
|
||||||
|
ORDER BY date ASC
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user