2015-04-05 69 views
1

我有一個int變量包含值例如。 31012015但我試圖將日期格式eg轉換爲dd-mm-yyyy。我查詢的部分是:如何將整數轉換爲日期Postgres dblink

select * from dblink(
    'dbname=dbexample port=5432 host=127.0.0.1 user=postgres password=root', 
    'select * from tableexample where fconclusion between 2014-01-02 and 2014-12-31') 
as k(
    id_principal integer, 
    nestrategia smallint, 
    ctitulo character varying(300), 
    factivacion date, 
    nestado smallint, 
    fcreacion timestamp without time zone, 
    id_usuario integer, 
    nstatus smallint, 
    nmunicipio smallint, 
    nactividad smallint, 
    fconclusion date, 
    id_personal integer, 
    nactivo smallint, 
    fmodificacion date, 
    nconclusion smallint 
) 

PgAdmin顯示下一個錯誤:

ERROR: operator does not exist: date> = integer HINT: No operator matches the name and type of arguments. You may need to add explicit type conversions. CONTEXT: Error Occurred on dblink connection named "unnamed": could not execute query.

有人能幫助我嗎?

回答