diff options
author | einhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46> | 2007-10-10 17:43:24 +0000 |
---|---|---|
committer | einhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46> | 2007-10-10 17:43:24 +0000 |
commit | 8066acc76d4098199b1bb60830dd881bd65f3900 (patch) | |
tree | 2263c4e4e47ad2aaa08ff8574f2a0397b7830ccd /sql/modules/Date.sql | |
parent | c7bed5b4b549b71f14acab6f1f55086f0fac899b (diff) |
Merging in David Mora's payment changes. Still working on the template and workflow scripts.
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@1735 4979c152-3d1c-0410-bac9-87ea11338e46
Diffstat (limited to 'sql/modules/Date.sql')
-rw-r--r-- | sql/modules/Date.sql | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/sql/modules/Date.sql b/sql/modules/Date.sql new file mode 100644 index 00000000..7b942c2a --- /dev/null +++ b/sql/modules/Date.sql @@ -0,0 +1,17 @@ +CREATE OR REPLACE FUNCTION date_get_all_years() returns setof INT AS +$$ +DECLARE + date_out record; + BEGIN + FOR date_out IN + SELECT EXTRACT('YEAR' from transdate) AS year + FROM acc_trans + GROUP BY EXTRACT('YEAR' from transdate) + ORDER BY year + LOOP + return next date_out.year; + END LOOP; + END; +$$ language plpgsql; +COMMENT ON FUNCTION date_get_all_years() IS +$$ This function return each year inside transdate in transactions. $$; |