Search Postgresql Archives

How to compare dates from two tables with blanks values

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I have a situation where I need to update dates in a primary table from regular imports of data, eg: this is the base select query

select d.row_id, fname||lname,'joineddate',d.joineddate,'joineddate',s.joineddate,0 as bool1 from import s join  members d on d.contact_id=s.contact_id where

cast(nullif(d.joineddate,NULL) as timestamp) != cast(nullif(s.joineddate,'') as timestamp)

This gives zero records, however I cant seem to get a query that works.
For non-date fields I just use Coalesce(fieldprime,'')!=coalesce(fieldiimport,'') which works fine but chokes on dates where there is a blank value

thanks in advance

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux