pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
format query
8+ messages / 6 participants
[nested] [flat]

* format query
@ 2005-03-09 12:22 enzo venegas palacios <enzovenegas@mixmail.com>
  2005-03-09 12:37 ` Re: format query Frank Bax <fbax@sympatico.ca>
  2005-03-09 15:07 ` Re: format query Todd Lewis <lewis-todd@sbcglobal.net>
  2005-03-09 15:16 ` Re: format query Christopher Kings-Lynne <chriskl@familyhealth.com.au>
  0 siblings, 3 replies; 8+ messages in thread

From: enzo venegas palacios @ 2005-03-09 12:22 UTC (permalink / raw)
  To: pgsql-php


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

I hope somebody can help me.

enzo
---------------------------------------------------------
¿Quieres saber cómo te ira en el amor? ¿en el trabajo? Nosotros te lo contamos http://astrocentro.mujeractual.com/ya
ADSL + Llamadas 24 horas: desde 28,95 €/mes + IVA. Navega y habla de forma ilimitada. Sin compromiso de permanencia. http://acceso.ya.com/ADSLllamadas/




^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: format query
  2005-03-09 12:22 format query enzo venegas palacios <enzovenegas@mixmail.com>
@ 2005-03-09 12:37 ` Frank Bax <fbax@sympatico.ca>
  2 siblings, 0 replies; 8+ messages in thread

From: Frank Bax @ 2005-03-09 12:37 UTC (permalink / raw)
  To: pgsql-php

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




^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: format query
  2005-03-09 12:22 format query enzo venegas palacios <enzovenegas@mixmail.com>
@ 2005-03-09 15:07 ` Todd Lewis <lewis-todd@sbcglobal.net>
  2 siblings, 0 replies; 8+ messages in thread

From: Todd Lewis @ 2005-03-09 15:07 UTC (permalink / raw)
  To: pgsql-php

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 = 01.
> but i don't know the specific query
> 
> I hope somebody can help me.
> 
> enzo
> ---------------------------------------------------------
> ¿Quieres saber cómo te ira en el amor? ¿en el trabajo? Nosotros te lo contamos http://astrocentro.mujeractual.com/ya
> ADSL + Llamadas 24 horas: desde 28,95 €/mes + IVA. Navega y habla de forma ilimitada. Sin compromiso de permanencia. http://acceso.ya.com/ADSLllamadas/
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster





^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: format query
  2005-03-09 12:22 format query enzo venegas palacios <enzovenegas@mixmail.com>
@ 2005-03-09 15:16 ` Christopher Kings-Lynne <chriskl@familyhealth.com.au>
  2 siblings, 0 replies; 8+ messages in thread

From: Christopher Kings-Lynne @ 2005-03-09 15:16 UTC (permalink / raw)
  To: enzovenegas@mixmail.com; +Cc: pgsql-php

> 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



^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: format query
@ 2005-03-17 14:20 enzo venegas palacios <enzovenegas@mixmail.com>
  2005-03-17 14:43 ` Re: format query sundaravel <zunderit@yahoo.co.in>
  2005-03-17 18:30 ` Re: format query Gary Hoffman <ghoffman@ucsd.edu>
  0 siblings, 2 replies; 8+ messages in thread

From: enzo venegas palacios @ 2005-03-17 14:20 UTC (permalink / raw)
  To: pgsql-php


I need to prove to be alone the date and not the hour of a table with format 
timestamp.

please.


enzo
---------------------------------------------------------
Redecora tu móvil. Redecora tu vida. ¿Por qué no? Con http://logos.ya.com es posible
ADSL + Llamadas 24 horas: desde 28,95 €/mes + IVA. Navega y habla de forma ilimitada. Sin compromiso de permanencia. http://acceso.ya.com/ADSLllamadas/




^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: format query
  2005-03-17 14:20 Re: format query enzo venegas palacios <enzovenegas@mixmail.com>
@ 2005-03-17 14:43 ` sundaravel <zunderit@yahoo.co.in>
  1 sibling, 0 replies; 8+ messages in thread

From: sundaravel @ 2005-03-17 14:43 UTC (permalink / raw)
  To: enzovenegas@mixmail.com; +Cc: pgsql-php

enzo venegas palacios wrote:

>I need to prove to be alone the date and not the hour of a table with format
>timestamp.
>
>please.
>
>
>enzo
>---------------------------------------------------------
>Redecora tu móvil. Redecora tu vida. ¿Por qué no? Con http://logos.ya.com es posible
>ADSL + Llamadas 24 horas: desde 28,95 €/mes + IVA. Navega y habla de forma ilimitada. Sin compromiso de permanencia. http://acceso.ya.com/ADSLllamadas/
>
>
>---------------------------(end of broadcast)---------------------------
>TIP 2: you can get off all lists at once with the unregister command
>    (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
>
>  
>
y u can try like this..

$arrDate = getdate();
$current_timestamp = $arrDate[0];

echo $current_timestamp;

// Output
1111070429

-S Sunder






^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: format query
  2005-03-17 14:20 Re: format query enzo venegas palacios <enzovenegas@mixmail.com>
@ 2005-03-17 18:30 ` Gary Hoffman <ghoffman@ucsd.edu>
  1 sibling, 0 replies; 8+ messages in thread

From: Gary Hoffman @ 2005-03-17 18:30 UTC (permalink / raw)
  To: pgsql-php; +Cc: enzovenegas@mixmail.com

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 you
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/ *
**************************************************************************







^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: format query
@ 2005-03-17 15:58 enzo venegas palacios <enzovenegas@mixmail.com>
  0 siblings, 0 replies; 8+ messages in thread

From: enzo venegas palacios @ 2005-03-17 15:58 UTC (permalink / raw)
  To: pgsql-php


i need to display only the date, for example

$fecha = 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óvil. Redecora tu vida. ¿Por qué no? Con http://logos.ya.com es posible
ADSL + Llamadas 24 horas: desde 28,95 €/mes + IVA. Navega y habla de forma ilimitada. Sin compromiso de permanencia. http://acceso.ya.com/ADSLllamadas/




^ permalink  raw  reply  [nested|flat] 8+ messages in thread


end of thread, other threads:[~2005-03-17 18:30 UTC | newest]

Thread overview: 8+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-03-09 12:22 format query enzo venegas palacios <enzovenegas@mixmail.com>
2005-03-09 12:37 ` Frank Bax <fbax@sympatico.ca>
2005-03-09 15:07 ` Todd Lewis <lewis-todd@sbcglobal.net>
2005-03-09 15:16 ` Christopher Kings-Lynne <chriskl@familyhealth.com.au>
2005-03-17 14:20 Re: format query enzo venegas palacios <enzovenegas@mixmail.com>
2005-03-17 14:43 ` sundaravel <zunderit@yahoo.co.in>
2005-03-17 18:30 ` Gary Hoffman <ghoffman@ucsd.edu>
2005-03-17 15:58 Re: format query enzo venegas palacios <enzovenegas@mixmail.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox