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 1 of 1 Topic 3431 of 3559
Post > Topic >>

Re: First day of month, last day of month

by Bart.Degryse@[EMAIL PROTECTED] ("Bart Degryse") Apr 24, 2008 at 03:11 PM

--=__Part416814F7.0__=
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable

select * from mytable where date_trunc('month', mydate) =3D
date_trunc('mon=
th', now());


>>> Frank Bax <fbax@[EMAIL PROTECTED]
> 2008-04-24 15:06 >>>
Nacef LABIDI wrote:
> is there a better method to retrieve all=20
> the rows with dates in the current month.


select * from mytable where extract(month from mydate) =3D
extract(month=20=

from now()) and extract(year from mydate) =3D extract(year from now());

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

--=__Part416814F7.0__=
Content-Type: text/html; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable

<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; charset=3Dutf-8">
<META content=3D"MSHTML 6.00.2800.1264" name=3DGENERATOR></HEAD>
<BODY style=3D"MARGIN: 4px 4px 1px; FONT: 10pt Tahoma">select * from =
mytable where date_trunc('month', mydate) =3D date_trunc('month', =
now());<BR><BR><BR>&gt;&gt;&gt; Frank Bax &lt;fbax@[EMAIL PROTECTED]
 =
2008-04-24 15:06 &gt;&gt;&gt;<BR>Nacef LABIDI wrote:<BR>&gt; is there a =
better method to retrieve all <BR>&gt; the rows with dates in the current
=
month.<BR><BR><BR>select * from mytable where extract(month from mydate) =
=3D extract(month <BR>from now()) and extract(year from mydate) =3D =
extract(year from now());<BR><BR>-- <BR>Sent via pgsql-sql mailing list =
(pgsql-sql@[EMAIL PROTECTED]
)<BR>To make changes to your subscription:<BR><A
=
href=3D"http://www.postgresql.org/mailpref/pgsql">http://www.postgresql.org=
/mailpref/pgsql</A>-sql<BR></BODY></HTML>

--=__Part416814F7.0__=--
 




 1 Posts in Topic:
Re: First day of month, last day of month
Bart.Degryse@[EMAIL PROTE  2008-04-24 15:11:03 

Post A Reply:
  Go here to Signup

AddThis Feed Button


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

Contact
tan13V112 Sun Jul 6 21:44:47 CDT 2008.