pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: miannaco@csc.com
To: pgsql-sql@postgresql.org
Subject: merging date and time
Date: Wed, 31 Mar 1999 15:03:19 +0100
Message-ID: <C1256745.004D28AB.00@csc.com> (raw)


Hi,
I'm experiencing some problems to create a view in which I put together a
date and a time in the same field...

I have a table which contain a date field (with a date inside) and a
varchar field with time inside..

This is the content of those two field in one record:

   |22-03-1999|14:45:27

I just wanted to create a view in which those two field are merged in a
datetime filed..

I tried using different approach but I'm always getting an error message or
 while creating the view or when selectin from the created view..

examples:

   create view glob_time as select datetime(euigw.day||euigw.time) as tempo
 from euigw;

gives me the following error message;

   ERROR:  There is more than one possible operator '||' for types 'date'
and 'varc
   har'
          You will have to retype this query using an explicit cast


create view glob_time as select datetime(text(euigw.day)||euigw.time) as
tempo from euigw;

works file, but then if I do select * from glob_time; I get:

ERROR:  Bad datetime external representation 'Mon 22 Mar 00:00:00 1999
MET14:45:
27'


does anyone have an idea about how to solve this?

thanks,

Marco





view thread (4+ messages)  latest in thread

Message-ID: <C1256745.004D28AB.00@csc.com>
Permalink:  ../C1256745.004D28AB.00@csc.com/
Also on:    postgresql.org/message-id/C1256745.004D28AB.00@csc.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: miannaco@csc.com
  Subject: Re: merging date and time
  In-Reply-To: <C1256745.004D28AB.00@csc.com>
  References: <C1256745.004D28AB.00@csc.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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