Merge date and varchar

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for PostgreSQL
Post Reply
HoGo

Merge date and varchar

Post by 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.

rwalrond
Posts: 4
Joined: Thu 14 Apr 2005 18:37

Re: Merge date and varchar

Post by 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

HoGo

Post by HoGo » Tue 26 Apr 2005 06:04

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

Post Reply