Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gZZXu-00085a-5K for pgsql-general@arkaria.postgresql.org; Wed, 19 Dec 2018 10:57:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gZZXr-0008G3-4i for pgsql-general@arkaria.postgresql.org; Wed, 19 Dec 2018 10:57:43 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gZZXq-0008Fw-Sm for pgsql-general@lists.postgresql.org; Wed, 19 Dec 2018 10:57:42 +0000 Received: from serveurmail01.codata.be ([82.146.123.190]) by magus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gZZXp-0004RV-3P for pgsql-general@lists.postgresql.org; Wed, 19 Dec 2018 10:57:42 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by serveurmail01.codata.be (Postfix) with ESMTP id 012A0900AD for ; Wed, 19 Dec 2018 11:57:40 +0100 (CET) X-Virus-Scanned: amavisd-new at serveurmail01.codata.be Received: from serveurmail01.codata.be ([127.0.0.1]) by localhost (serveurmail01.codata.be [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id uoTlTBt-ypRe for ; Wed, 19 Dec 2018 11:57:39 +0100 (CET) Received: from [10.0.0.100] (38-179-112-217.fix.adsl.belcenter.be [217.112.179.38]) by serveurmail01.codata.be (Postfix) with ESMTPSA id 7D80B900A3 for ; Wed, 19 Dec 2018 11:57:39 +0100 (CET) Subject: Re: How to compare dates from two tables with blanks values To: pgsql-general@lists.postgresql.org References: Reply-To: arnaud.listes@codata.eu From: "Arnaud L." Message-ID: <90466dc3-66f2-7db4-b716-6a5d344a1b49@codata.eu> Date: Wed, 19 Dec 2018 11:57:38 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.3.3 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: fr Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Le 19/12/2018 à 11:41, Mike Martin a écrit : > cast(nullif(d.joineddate,NULL) as timestamp) != cast(nullif(s.joineddate,'') as timestamp) Try with d.joineddate IS DISTINCT FROM s.joineddate https://www.postgresql.org/docs/current/functions-comparison.html Cheers -- Arnaud