Re: [GENERAL] Strange? BETWEEN behaviour.

2016-10-20 Thread Scott Marlowe
On Thu, Oct 20, 2016 at 6:27 AM, Bjørn T Johansen wrote: > On Thu, 20 Oct 2016 14:04:51 +0200 > vinny wrote: > >> On 2016-10-20 13:51, Bjørn T Johansen wrote: >> > I have the following SQL: >> > >> > SELECT * from table WHERE date BETWEEN to_timestamp('20.10.2016 >> > 00:00:00','DD.MM. HH24:M

Re: [GENERAL] Strange? BETWEEN behaviour.

2016-10-20 Thread Francisco Olarte
Bjørn: On Thu, Oct 20, 2016 at 4:13 PM, Bjørn T Johansen wrote: > Yes, the field name is actually dato but changed it to the English variant.. I routinely have databases with english column names for nearly everything except 'fecha', spanish for date, and 'tipo', spanish for type which sometime

Re: [GENERAL] Strange? BETWEEN behaviour.

2016-10-20 Thread Bjørn T Johansen
On Thu, 20 Oct 2016 15:16:20 +0200 Francisco Olarte wrote: > On Thu, Oct 20, 2016 at 1:51 PM, Bjørn T Johansen wrote: > > I have the following SQL: > > SELECT * from table WHERE date BETWEEN to_timestamp('20.10.2016 > > 00:00:00','DD.MM. HH24:MI:SS') AND to_timestamp('20.10.2016 > > 23:59:

Re: [GENERAL] Strange? BETWEEN behaviour.

2016-10-20 Thread Francisco Olarte
On Thu, Oct 20, 2016 at 1:51 PM, Bjørn T Johansen wrote: > I have the following SQL: > SELECT * from table WHERE date BETWEEN to_timestamp('20.10.2016 > 00:00:00','DD.MM. HH24:MI:SS') AND to_timestamp('20.10.2016 > 23:59:59','DD.MM. > HH24:MI:SS') > date is of type timestamp. > I was exp

Re: [GENERAL] Strange? BETWEEN behaviour.

2016-10-20 Thread Francisco Olarte
Bottom quoting makes it difficult to reply properly, so reformated a bit: On Thu, Oct 20, 2016 at 2:02 PM, William Ivanski wrote: > Em qui, 20 de out de 2016 às 09:52, Bjørn T Johansen > escreveu: >> date is of type timestamp. > select * from table where date = '2016/10/20'::date I think is the

Re: [GENERAL] Strange? BETWEEN behaviour.

2016-10-20 Thread vinny
On 2016-10-20 14:27, Bjørn T Johansen wrote: On Thu, 20 Oct 2016 14:04:51 +0200 vinny wrote: On 2016-10-20 13:51, Bjørn T Johansen wrote: > I have the following SQL: > > SELECT * from table WHERE date BETWEEN to_timestamp('20.10.2016 > 00:00:00','DD.MM. HH24:MI:SS') AND to_timestamp('20.10

Re: [GENERAL] Strange? BETWEEN behaviour.

2016-10-20 Thread rob stone
On Thu, 2016-10-20 at 13:51 +0200, Bjørn T Johansen wrote: > I have the following SQL: > > SELECT * from table WHERE date BETWEEN to_timestamp('20.10.2016 > 00:00:00','DD.MM. HH24:MI:SS') AND to_timestamp('20.10.2016 > 23:59:59','DD.MM. > HH24:MI:SS') > > date is of type timestamp. > >

Re: [GENERAL] Strange? BETWEEN behaviour.

2016-10-20 Thread Bjørn T Johansen
On Thu, 20 Oct 2016 14:04:51 +0200 vinny wrote: > On 2016-10-20 13:51, Bjørn T Johansen wrote: > > I have the following SQL: > > > > SELECT * from table WHERE date BETWEEN to_timestamp('20.10.2016 > > 00:00:00','DD.MM. HH24:MI:SS') AND to_timestamp('20.10.2016 > > 23:59:59','DD.MM. > > H

Re: [GENERAL] Strange? BETWEEN behaviour.

2016-10-20 Thread Bjørn T Johansen
Yes, that's what I am doing now but I was just wondering why the other way did not work... BTJ On Thu, 20 Oct 2016 12:02:14 + William Ivanski wrote: > You could try: > > select * from table where date = '2016/10/20'::date > > Em qui, 20 de out de 2016 às 09:52, Bjørn T Johansen > escrev

Re: [GENERAL] Strange? BETWEEN behaviour.

2016-10-20 Thread vinny
On 2016-10-20 13:51, Bjørn T Johansen wrote: I have the following SQL: SELECT * from table WHERE date BETWEEN to_timestamp('20.10.2016 00:00:00','DD.MM. HH24:MI:SS') AND to_timestamp('20.10.2016 23:59:59','DD.MM. HH24:MI:SS') date is of type timestamp. I was expecting to get all the re

Re: [GENERAL] Strange? BETWEEN behaviour.

2016-10-20 Thread William Ivanski
You could try: select * from table where date = '2016/10/20'::date Em qui, 20 de out de 2016 às 09:52, Bjørn T Johansen escreveu: > I have the following SQL: > > SELECT * from table WHERE date BETWEEN to_timestamp('20.10.2016 > 00:00:00','DD.MM. HH24:MI:SS') AND to_timestamp('20.10.2016 > 2

[GENERAL] Strange? BETWEEN behaviour.

2016-10-20 Thread Bjørn T Johansen
I have the following SQL: SELECT * from table WHERE date BETWEEN to_timestamp('20.10.2016 00:00:00','DD.MM. HH24:MI:SS') AND to_timestamp('20.10.2016 23:59:59','DD.MM. HH24:MI:SS') date is of type timestamp. I was expecting to get all the records that had datepart = 20.10.2016 but I am