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 Sql > Re: First day o...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 15 of 15 Topic 3430 of 3799
Post > Topic >>

Re: First day of month, last day of month

by nacef.l@[EMAIL PROTECTED] ("Nacef LABIDI") Apr 24, 2008 at 06:39 PM

------=_Part_12803_3737840.1209055146769
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

It would be rather :

test=*# select date_trunc('month', current_date), date_trunc('month',
current_date)+'1month':
>
> :interval-'1sec'::interval;


"2008-04-01 00:00:00+02";"2008-04-30 23:59:59+02"


On Thu, Apr 24, 2008 at 3:15 PM, A. Kretschmer <
andreas.kretschmer@[EMAIL PROTECTED]
> wrote:

> am  Thu, dem 24.04.2008, um 14:59:47 +0200 mailte Nacef LABIDI
folgendes:
> > Hi all,
> >
> > I want to select data from a table according to a date column in my
> table. I
> > want to select all the rows which have date in the current month. So
is
> there a
> > way to get from the actual date the first day and the last day of the
> month or
>
> test=*# select date_trunc('month', current_date), date_trunc('month',
> current_date)+'1month'::interval-'1day'::interval;
>       date_trunc       |        ?column?
> ------------------------+------------------------
>  2008-04-01 00:00:00+02 | 2008-04-30 00:00:00+02
>
>
>
> --
> Andreas Kretschmer
> Kontakt:  Heynitz: 035242/47150,   D1: 0160/7141639 (mehr: -> Header)
> GnuPG-ID:   0x3FFF606C, privat 0x7F4584DA   http://wwwkeys.de.pgp.net
>
> --
> Sent via pgsql-sql mailing list (pgsql-sql@[EMAIL PROTECTED]
)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-sql
>

------=_Part_12803_3737840.1209055146769
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

It would be rather :<br><br>test=*# select date_trunc(&#39;month&#39;,
current_date), date_trunc(&#39;month&#39;,
current_date)+&#39;1month&#39;:<blockquote class="gmail_quote"
style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt
0.8ex; padding-left: 1ex;">
:interval-&#39;1sec&#39;::interval;</blockquote><div><br>&quot;2008-04-01
00:00:00+02&quot;;&quot;2008-04-30 23:59:59+02&quot;
<br></div><br><br><div class="gmail_quote">On Thu, Apr 24, 2008 at 3:15
PM, A. Kretschmer &lt;<a
href="mailto:andreas.kretschmer@[EMAIL PROTECTED]
">andreas.kretschmer@[EMAIL PROTECTED]
>&gt;
wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204,
204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">am &nbsp;Thu,
dem 24.04.2008, um 14:59:47 +0200 mailte Nacef LABIDI folgendes:<br>
<div class="Ih2E3d">&gt; Hi all,<br>
&gt;<br>
&gt; I want to select data from a table according to a date column in my
table. I<br>
&gt; want to select all the rows which have date in the current month. So
is there a<br>
&gt; way to get from the actual date the first day and the last day of the
month or<br>
<br>
</div>test=*# select date_trunc(&#39;month&#39;, current_date),
date_trunc(&#39;month&#39;,
current_date)+&#39;1month&#39;::interval-&#39;1day&#39;::interval;<br>
 &nbsp; &nbsp; &nbsp; date_trunc &nbsp; &nbsp; &nbsp; | &nbsp; &nbsp;
&nbsp; &nbsp;?column?<br>
------------------------+------------------------<br>
&nbsp;2008-04-01 00:00:00+02 | 2008-04-30 00:00:00+02<br>
<font color="#888888"><br>
<br>
<br>
--<br>
Andreas Kretschmer<br>
Kontakt: &nbsp;Heynitz: 035242/47150, &nbsp; D1: 0160/7141639 (mehr: -&gt;
Header)<br>
GnuPG-ID: &nbsp; 0x3FFF606C, privat 0x7F4584DA &nbsp; <a
href="http://wwwkeys.de.pgp.net"
target="_blank">http://wwwkeys.de.pgp.net</a><br>
</font><div><div></div><div class="Wj3C7c"><br>
--<br>
Sent via pgsql-sql mailing list (<a
href="mailto:pgsql-sql@[EMAIL PROTECTED]
">pgsql-sql@[EMAIL PROTECTED]
>)<br>
To make changes to your subscription:<br>
<a href="http://www.postgresql.org/mailpref/pgsql-sql"
target="_blank">http://www.postgresql.org/mailpref/pgsql-sql</a><br>
</div></div></blockquote></div><br>

------=_Part_12803_3737840.1209055146769--
 




 15 Posts in Topic:
First day of month, last day of month
nacef.l@[EMAIL PROTECTED]  2008-04-24 14:59:47 
Re: First day of month, last day of month
fbax@[EMAIL PROTECTED] (  2008-04-24 09:06:25 
Re: First day of month, last day of month
fbax@[EMAIL PROTECTED] (  2008-04-24 09:16:03 
Re: First day of month, last day of month
andreas.kretschmer@[EMAIL  2008-04-24 15:15:36 
Re: First day of month, last day of month
cww@[EMAIL PROTECTED] (C  2008-04-24 10:15:23 
Re: First day of month, last day of month
erik@[EMAIL PROTECTED] (  2008-04-24 09:41:04 
Re: First day of month, last day of month
nacef.l@[EMAIL PROTECTED]  2008-04-24 16:43:40 
Re: First day of month, last day of month
scott.marlowe@[EMAIL PROT  2008-04-24 08:55:31 
Re: First day of month, last day of month
fhevia@[EMAIL PROTECTED]   2008-04-24 12:10:34 
Re: First day of month, last day of month
scott.marlowe@[EMAIL PROT  2008-04-24 08:56:50 
Re: First day of month, last day of month
erik@[EMAIL PROTECTED] (  2008-04-24 10:08:10 
Re: First day of month, last day of month
scott.marlowe@[EMAIL PROT  2008-04-24 09:16:01 
Re: First day of month, last day of month
scott.marlowe@[EMAIL PROT  2008-04-24 09:44:44 
Re: First day of month, last day of month
fhevia@[EMAIL PROTECTED]   2008-04-24 13:07:19 
Re: First day of month, last day of month
nacef.l@[EMAIL PROTECTED]  2008-04-24 18:39:06 

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 21:20:20 CST 2008.