Re: Get date timestamp(3) without time zone column - PGSQL 9.5

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Patrick B <patrickbakerbr(at)gmail(dot)com>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Get date timestamp(3) without time zone column - PGSQL 9.5
Date: 2016-09-05 03:18:04
Message-ID: 29772.1473045484@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Patrick B <patrickbakerbr(at)gmail(dot)com> writes:
> I'm trying to cast the date, using this query:
>> SELECT cast(tasks_start as date) FROM "jobs" WHERE "tasks"."deleted" = 'f'
>> AND "tasks"."recurrence_id" = 1 AND (Date(tasks_start) in ('2016-08-10')
> but it doesn't work.. I get 0 rows... what am I doing wrong?

Are you sure you're not getting an error? The query is specifying fields
in "tasks" but the FROM clause only lists "jobs".

Either one of those two cast-to-date syntaxes should work, so your problem
is somewhere else.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Pavel Stehule 2016-09-05 03:34:39 Re: Get date timestamp(3) without time zone column - PGSQL 9.5
Previous Message Patrick B 2016-09-05 03:17:46 Re: Get date timestamp(3) without time zone column - PGSQL 9.5