Re: [tryton-dev] Covert datetime as date in a sqlite pythonsql query

2017-06-26 Thread Nicolás López Solano
2017-06-26 16:10 GMT+02:00 Sergi Almacellas Abellana :

> El 26/06/17 a les 16:07, Nicolás López Solano ha escrit:
>
>> Hi,
>>
>> I need to writte a pythonsql query with a date column computed converting
>> a datetime column. I'm using Cast function to do that but only works for
>> postgresql and i need it works for sqlite too. I tried to use anothers
>> pythonsql functions like ToDate or DatePart but only work for postgresql
>> too.
>>
> Can you show which current code do you have?
>
> Have you tried:
>
> Cast(column, 'DATE')
>

Yes i tried. For postgresql it return a correct date but for sqlite it
return only the year of the datetime base column.

If i work directly executing sql (select cast(column as date) from mytable)
over a sqlite file i get a similar "not good" result. Cast sqlite native
functión can't covert to date.

>
> Which errors do you have?
>
No errors ... only not ok result

>
>
> --
> Sergi Almacellas Abellana
> www.koolpi.com
> Twitter: @pokoli_srk
>
> --
> You received this message because you are subscribed to the Google Groups
> "tryton-dev" group.
> To view this discussion on the web visit https://groups.google.com/d/ms
> gid/tryton-dev/5f0a2c6d-e249-5d57-6019-cc246090498b%40koolpi.com.
>

-- 
You received this message because you are subscribed to the Google Groups 
"tryton-dev" group.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tryton-dev/CANd2Za3RH%2BBAGGH%3Df0_A72RvsOEgYwMbeOfHqA%2BMqyvtLoP7ow%40mail.gmail.com.


Re: [tryton-dev] Covert datetime as date in a sqlite pythonsql query

2017-06-26 Thread Sergi Almacellas Abellana

El 26/06/17 a les 16:07, Nicolás López Solano ha escrit:

Hi,

I need to writte a pythonsql query with a date column computed 
converting a datetime column. I'm using Cast function to do that but 
only works for postgresql and i need it works for sqlite too. I tried to 
use anothers pythonsql functions like ToDate or DatePart but only work 
for postgresql too.

Can you show which current code do you have?

Have you tried:

Cast(column, 'DATE')

Which errors do you have?


--
Sergi Almacellas Abellana
www.koolpi.com
Twitter: @pokoli_srk

--
You received this message because you are subscribed to the Google Groups 
"tryton-dev" group.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tryton-dev/5f0a2c6d-e249-5d57-6019-cc246090498b%40koolpi.com.


[tryton-dev] Covert datetime as date in a sqlite pythonsql query

2017-06-26 Thread Nicolás López Solano
Hi,

I need to writte a pythonsql query with a date column computed converting a 
datetime column. I'm using Cast function to do that but only works for 
postgresql and i need it works for sqlite too. I tried to use anothers 
pythonsql functions like ToDate or DatePart but only work for postgresql 
too.

Any sugest?

Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"tryton-dev" group.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tryton-dev/7bade533-f9b6-4a02-bbbf-bc9bb078d76f%40googlegroups.com.


Re: [tryton-dev] uri = postgresql:/// depreciated?

2017-06-26 Thread Sergi Almacellas Abellana

El 25/06/17 a les 10:50, Axel Braun ha escrit:

Hi Sergi,

thanks for your input!
I changed connection to TCP and used uri = 
postgresql://uswer:passwd@localhost:5432

No idea why the former method is not working anymore

I give a quick test and posgresql:/// is working correctly for me.



--
Sergi Almacellas Abellana
www.koolpi.com
Twitter: @pokoli_srk

--
You received this message because you are subscribed to the Google Groups 
"tryton-dev" group.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tryton-dev/204ccbb8-e87d-f1f1-d377-49bba4b2d62b%40koolpi.com.