Merge date and varchar

Merge date and varchar

Postby HoGo » Mon 25 Apr 2005 15:01

Hi!

I have one little question. I need to merge into one field: one date field and one varchar field for dataset. I try it like this:

Code: Select all
SELECT (date+name) AS logitem FROM tablename


I receive error message: unable to identify an operator '+' for types 'date' and 'character varying'. I was search for some function with I could convert date to varchar but I couldn't found it.

Than You for your help.
HoGo
 

Re: Merge date and varchar

Postby rwalrond » Mon 25 Apr 2005 20:29

HoGo wrote:Hi!

I have one little question. I need to merge into one field: one date field and one varchar field for dataset. I try it like this:

Code: Select all
SELECT (date+name) AS logitem FROM tablename


I receive error message: unable to identify an operator '+' for types 'date' and 'character varying'. I was search for some function with I could convert date to varchar but I couldn't found it.

Than You for your help.


Your query should look something like this:
Code: Select all
SELECT (date::varchar || name) AS logitem FROM tablename
rwalrond
 
Posts: 4
Joined: Thu 14 Apr 2005 18:37

Postby HoGo » Tue 26 Apr 2005 06:04

Oh yes, thank you. I can use || ...
HoGo
 


Return to dotConnect for PostgreSQL