Hey, Simon,

Length(theDate) returns 9, and typeof(theDate) returns "real".  I assume typeof 
is just returning the character version of the column affinity.

Typeof(MAX(theDate)) and length(MAX(theDate)) also return "real" and 9 
respectively.

At this point, I am rethinking the decision to convert our application's native 
dates to Julian dates when moving them into SQLite.  I think I made that 
decision (been a while) so that SQLite's date functions could be applied to the 
data.  But SQLite doesn't really have any functions that manipulate Julian 
dates (as far as I can tell).  We have written our own SQL date functions 
anyway.  So maybe I can just avoid this issue entirely.

Eric

-----Original Message-----
From: sqlite-users-bounces at mailinglists.sqlite.org 
[mailto:sqlite-users-boun...@mailinglists.sqlite.org] On Behalf Of Simon Slavin
Sent: Monday, February 22, 2016 11:12 AM
To: SQLite mailing list <sqlite-users at mailinglists.sqlite.org>
Subject: Re: [sqlite] MIN/MAX of column loses decltype


On 22 Feb 2016, at 4:02pm, Eric Hill <Eric.Hill at jmp.com> wrote:

> I can call sqlite3_column_decltype() and get back "REAL_DATE" and know I 
> should convert.
> 
> However, if I execute this SQL:
> 
> SELECT MAX( theDate ) FROM t1;
> 
> My call to sqlite3_column_decltype() returns nothing - the decltype of the 
> column being aggregated is not preserved by the MAX() operation.

What happens for

SELECT theDate,length(theDate),typeof(theDate) FROM t1 LIMIT 1;

?
_______________________________________________
sqlite-users mailing list
sqlite-users at mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to