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

2016-09-05 Thread Patrick B
Hi guys, You were right, there was something wrong with my original query: SELECT cast(tasks_start as date) FROM "tasks" WHERE (Date(tasks_start) in > ('2016-08-10'); I was able to get the expected data using the above query... Cheers Patrick

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

2016-09-04 Thread amulsul
Try using double colon opperator instead of cast().   E. g.  task_start::date Regards, Amul Sent from a mobile device. Please excuse brevity and tpyos. On Mon, 5 Sep, 2016 at 8:29 am, Patrick

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

2016-09-04 Thread Lucas Possamai
2016-09-05 15:17 GMT+12:00 Patrick B : > >> You might want to share the version of PostgreSQL you are using. >> >> You might want to try date_trunc and AT TIMEZONE function/operators- >> >> https://www.postgresql.org/docs/9.4/static/functions-datetim >> e.html#FUNCTIONS-DATETIME-TRUNC >> >> SELECT

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

2016-09-04 Thread Pavel Stehule
2016-09-05 5:17 GMT+02:00 Patrick B : > >> You might want to share the version of PostgreSQL you are using. >> >> You might want to try date_trunc and AT TIMEZONE function/operators- >> >> https://www.postgresql.org/docs/9.4/static/functions-datetim >> e.html#FUNCTIONS-DATETIME-TRUNC >> >> SELECT

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

2016-09-04 Thread Patrick B
> > > You might want to share the version of PostgreSQL you are using. > > You might want to try date_trunc and AT TIMEZONE function/operators- > > https://www.postgresql.org/docs/9.4/static/functions- > datetime.html#FUNCTIONS-DATETIME-TRUNC > > SELECT date_trunc('day', tasks_start at TIME ZONE 'E

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

2016-09-04 Thread Tom Lane
Patrick B 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

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

2016-09-04 Thread Sameer Kumar
On Mon, Sep 5, 2016 at 10:59 AM Patrick B wrote: > Hi guys, > > I got the tasks table that has the tasks_start column: > >> tasks_start| timestamp(3) without time zone > > > > select tasks_start from tasks LIMIT 1; > >> tasks_start >> --- >> 2016-08-10 00:30:00 > > > I'm