Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql General > Date / interval...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 3 Topic 15251 of 17602
Post > Topic >>

Date / interval question

by kevin@[EMAIL PROTECTED] (kevin kempter) Apr 10, 2008 at 09:26 PM

Hi List;

I'm populating a time dimension. I need to get the number of days  
since the start of the fiscal year and also the number of months since  
the start of the fiscal year based on the current 'date' being  
processed.

Example:

my current process date is 01/01/2007
start date of fiscal year is 09/01/2006

I can get the number of days since the start of the fiscal year like  
this:

# select date '01/01/2007' -  date '09/01/2006' as interval;
  interval
----------
       122
(1 row)

However I'm stumped [er how to get the number of months from  
09/01/2007 thru 01/01/2007

Thoughts ?

Thanks in advance...


-- 
Sent via pgsql-general mailing list (pgsql-general@[EMAIL PROTECTED]
)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
 




 3 Posts in Topic:
Date / interval question
kevin@[EMAIL PROTECTED]   2008-04-10 21:26:14 
Re: Date / interval question
rdeleonp@[EMAIL PROTECTED  2008-04-11 07:43:38 
Re: Date / interval question
andreas.kretschmer@[EMAIL  2008-04-11 07:02:44 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Mon Dec 1 18:49:59 CST 2008.