format query
am 09.03.2005 13:22:53 von enzo venegas palacios
I am trying to build a query sql that select all rows in my table with a
spesific month (format timestamp, yyy-mm-dd hh:mm:ss), for example, all of
january, select * from table where field_date =3D 01.
but i don't know the specific query
I hope somebody can help me.
enzo
---------------------------------------------------------
=BFQuieres saber c=F3mo te ira en el amor? =BFen el trabajo? Nosotros te lo=
contamos http://astrocentro.mujeractual.com/ya
ADSL + Llamadas 24 horas: desde 28,95 =80/mes + IVA. Navega y habla de form=
a ilimitada. Sin compromiso de permanencia. http://acceso.ya.com/ADSLllamad=
as/
---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster
Re: format query
am 09.03.2005 13:37:40 von Frank Bax
At 07:22 AM 3/9/05, enzo venegas palacios wrote:
>I am trying to build a query sql that select all rows in my table with a
>spesific month (format timestamp, yyy-mm-dd hh:mm:ss), for example, all of
>january, select * from table where field_date = 01.
>but i don't know the specific query
WHERE date_part('month',field_date) = 01
---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly
Re: format query
am 09.03.2005 16:07:57 von Todd Lewis
use the to_char function to specify the format in your where clause.
>
> I am trying to build a query sql that select all rows in my table with a
> spesific month (format timestamp, yyy-mm-dd hh:mm:ss), for example, all of
> january, select * from table where field_date =3D 01.
> but i don't know the specific query
>
> I hope somebody can help me.
>
> enzo
> ---------------------------------------------------------
> =BFQuieres saber c=F3mo te ira en el amor? =BFen el trabajo? Nosotros te =
lo contamos http://astrocentro.mujeractual.com/ya
> ADSL + Llamadas 24 horas: desde 28,95 =80/mes + IVA. Navega y habla de fo=
rma ilimitada. Sin compromiso de permanencia. http://acceso.ya.com/ADSLllam=
adas/
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
Re: format query
am 09.03.2005 16:16:43 von Christopher Kings-Lynne
> I am trying to build a query sql that select all rows in my table with a
> spesific month (format timestamp, yyy-mm-dd hh:mm:ss), for example, all of
> january, select * from table where field_date = 01.
> but i don't know the specific query
select * from table where extract(month from field) = 1;
Chris
---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly
Re: format query
am 17.03.2005 15:20:35 von enzo venegas palacios
I need to prove to be alone the date and not the hour of a table with format
timestamp.
please.
enzo
---------------------------------------------------------
Redecora tu m=F3vil. Redecora tu vida. =BFPor qu=E9 no? Con http://logos.ya=
..com es posible
ADSL + Llamadas 24 horas: desde 28,95 =80/mes + IVA. Navega y habla de form=
a ilimitada. Sin compromiso de permanencia. http://acceso.ya.com/ADSLllamad=
as/
---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
Re: format query
am 17.03.2005 15:43:05 von sundaravel
enzo venegas palacios wrote:
>I need to prove to be alone the date and not the hour of a table with fo=
rmat
>timestamp.
>
>please.
>
>
>enzo
>---------------------------------------------------------
>Redecora tu m=F3vil. Redecora tu vida. =BFPor qu=E9 no? Con http://logos=
..ya.com es posible
>ADSL + Llamadas 24 horas: desde 28,95 =80/mes + IVA. Navega y habla de f=
orma ilimitada. Sin compromiso de permanencia. http://acceso.ya.com/ADSLl=
lamadas/
>
>
>---------------------------(end of broadcast)---------------------------
>TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
>
> =20
>
y u can try like this..
$arrDate =3D getdate();
$current_timestamp =3D $arrDate[0];
echo $current_timestamp;
// Output
1111070429
-S Sunder
---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster
Re: format query
am 17.03.2005 16:58:35 von enzo venegas palacios
i need to display only the date, for example
$fecha =3D dd/mm/yyy hh:mm:ss (format timestamp)
see only dd/mm/yyyy
how extract only date from the var ($fecha)
enzo
---------------------------------------------------------
Redecora tu m=F3vil. Redecora tu vida. =BFPor qu=E9 no? Con http://logos.ya=
..com es posible
ADSL + Llamadas 24 horas: desde 28,95 =80/mes + IVA. Navega y habla de form=
a ilimitada. Sin compromiso de permanencia. http://acceso.ya.com/ADSLllamad=
as/
---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?
http://www.postgresql.org/docs/faq
Re: format query
am 17.03.2005 19:30:38 von Gary Hoffman
enzovenegas@mixmail.com writes:
>I need to prove to be alone the date and not the hour of a table with
>format
>timestamp.
>
>please.
Enzo,
I've used two different methods:
-The SQL string function substr(string) gets the parts of the result that
you need, where the date is cast as text.
-The PostgreSql SQL function epoch(timestamp) in your query gets the
timestamp as a numeric that the PHP function date() can format however yo=
u
want.
Good luck,
Gary
************************************************************ *************=
*
* Gary B. Hoffman, Computing Services Manager e-mail: ghoffman@ucsd.edu =
*
* Graduate School of International Relations and Pacific Studies (IR/PS) =
*
* University of California, San Diego (UCSD) voice: (858) 534-1989 =
*
* 9500 Gilman Dr. MC 0519 fax: (858) 534-3939 =
*
* La Jolla, CA 92093-0519 USA web: http://irps.ucsd.edu/ =
*
************************************************************ *************=
*
---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly