date_part???

Started by jeromeover 23 years ago3 messagesgeneral
Jump to latest
#1jerome
jerome@gmanmi.tv

i have a table
Attribute | Type | Modifier
-----------+-----------+----------
test | timestamp |

SELECT date_part('hour', TIMESTAMP 'timestamp(test)') from testing;
ERROR: Bad timestamp external representation 'timestamp(test)'

** this one gives me an error but the DOCU says:
-- date_part(text, timestamp)

#2Martijn van Oosterhout
kleptog@svana.org
In reply to: jerome (#1)
Re: date_part???

How about just:

SELECT date_part('hour', test) from testing;

On Thu, Aug 29, 2002 at 05:30:31PM +0800, jerome wrote:

i have a table
Attribute | Type | Modifier
-----------+-----------+----------
test | timestamp |

SELECT date_part('hour', TIMESTAMP 'timestamp(test)') from testing;
ERROR: Bad timestamp external representation 'timestamp(test)'

** this one gives me an error but the DOCU says:
-- date_part(text, timestamp)

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

--
Martijn van Oosterhout <kleptog@svana.org> http://svana.org/kleptog/

Show quoted text

There are 10 kinds of people in the world, those that can do binary
arithmetic and those that can't.

#3Stephan Szabo
sszabo@megazone23.bigpanda.com
In reply to: jerome (#1)
Re: date_part???

On Thu, 29 Aug 2002, jerome wrote:

i have a table
Attribute | Type | Modifier
-----------+-----------+----------
test | timestamp |

SELECT date_part('hour', TIMESTAMP 'timestamp(test)') from testing;
ERROR: Bad timestamp external representation 'timestamp(test)'

** this one gives me an error but the DOCU says:
-- date_part(text, timestamp)

TIMESTAMP '...' is for timestamp literals. timestamp(test) isn't a
literal. You probably just want test.