[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb:[3441] trunk/sql/upgrade/3441-periods-view.sql



Revision: 3441
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=3441&view=rev
Author:   einhverfr
Date:     2011-07-05 08:52:42 +0000 (Tue, 05 Jul 2011)

Log Message:
-----------
Minor correction to utils merge

Added Paths:
-----------
    trunk/sql/upgrade/3441-periods-view.sql

Added: trunk/sql/upgrade/3441-periods-view.sql
===================================================================
--- trunk/sql/upgrade/3441-periods-view.sql	                        (rev 0)
+++ trunk/sql/upgrade/3441-periods-view.sql	2011-07-05 08:52:42 UTC (rev 3441)
@@ -0,0 +1,12 @@
+
+CREATE OR REPLACE VIEW periods AS
+SELECT 'ytd' as id, 'Year to Date' as label, now()::date as date_to, 
+       (extract('year' from now())::text || '-01-01')::date as date_from
+UNION
+SELECT 'last_year', 'Last Year', 
+       ((extract('YEAR' from now()) - 1)::text || '-12-31')::date as date_to,
+       ((extract('YEAR' from now()) - 1)::text || '-01-01')::date as date_from
+;
+
+GRANT SELECT ON periods TO public;
+


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.