Sorting by month with two dates input

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

Sorting by month with two dates input

jose isaias cabrera

Greetings!

I have to create some reporting and I need to report on customers amount1
and amount2 two based on the whole year of 2013.  There are two dates that
are to be used as input: billdate and bdate.  I can do one or the other,
but, I can not seem to get the correct date when using both.  The criteria
is that if there is a billdate, that overides the bdate, so the billdate
should be the one used and reported on.  If there is no billdate, then,
bdate is used.  There is always a bdate as this is the date the project was
opened, so all projects have a bdate.  But, not all projects may have a
billdate. This is what I am trying...

SELECT cust, sum(ProjFund), sum(Xtra8), coalesce(billdate,bdate) as t FROM
LSOpenProjects WHERE billdate BETWEEN '2013-01-01' AND '2013-12-31' OR bdate
BETWEEN '2013-01-01' AND '2013-12-31' GROUP BY substr(t,1,7), cust;

But this is not working correctly, as the beginning of the result, there is
no number because billdate is empty.  So, I get a list like this:

Co01|13016.16|20024.46|
Co02|12280.0|110.0|
Co03|550.0|0.0|
Co04|1317.49|285.72|
Co05|747.0|0.0|
Co05|187330.3|39076.85|
Co07|14148.39|0.0|
Co08|156011.68|6725.09|
Co09|10890.92|142.98|
Co10|333.34|0.0|
Co11|294.39|214.29|
Co12|14857.29|0.0|
Co02|402.16|522.28|2012-02-15
Co04|3506.5|3976.11|2013-01-15
Co05|270.29|351.03|2013-01-15
Co06|1273.17|0.0|2013-01-15
Co10|16337.75|21217.83|2013-01-15

but there should always be a date.  Any help would be greatly appreciated.
Thanks.

josé

_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Sorting by month with two dates input

Darren Duncan
On 2014-08-31, 9:10 PM, jose isaias cabrera wrote:
> SELECT cust, sum(ProjFund), sum(Xtra8), coalesce(billdate,bdate) as t FROM
> LSOpenProjects WHERE billdate BETWEEN '2013-01-01' AND '2013-12-31' OR bdate
> BETWEEN '2013-01-01' AND '2013-12-31' GROUP BY substr(t,1,7), cust;

I'm surprised that even compiles, since AFAIK the SELECT clause is evaluated
after the GROUP BY clause, and t doesn't exist yet at the GROUP BY stage (unless
you have another one in LSOpenProjects).

Maybe try using a subquery to force correct evaluation order?

Kind of like this:

SELECT cust, sum(ProjFund), sum(Xtra8), t FROM (
SELECT cust, ProjFund, Xtra8, coalesce(billdate,bdate) as t FROM
LSOpenProjects WHERE billdate BETWEEN '2013-01-01' AND '2013-12-31' OR bdate
BETWEEN '2013-01-01' AND '2013-12-31'
) x GROUP BY substr(t,1,7), cust;

-- Darren Duncan
_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Sorting by month with two dates input

Darren Duncan
On 2014-08-31, 9:35 PM, Darren Duncan wrote:

> On 2014-08-31, 9:10 PM, jose isaias cabrera wrote:
>> SELECT cust, sum(ProjFund), sum(Xtra8), coalesce(billdate,bdate) as t FROM
>> LSOpenProjects WHERE billdate BETWEEN '2013-01-01' AND '2013-12-31' OR bdate
>> BETWEEN '2013-01-01' AND '2013-12-31' GROUP BY substr(t,1,7), cust;
>
> I'm surprised that even compiles, since AFAIK the SELECT clause is evaluated
> after the GROUP BY clause, and t doesn't exist yet at the GROUP BY stage (unless
> you have another one in LSOpenProjects).
>
> Maybe try using a subquery to force correct evaluation order?
>
> Kind of like this:
>
> SELECT cust, sum(ProjFund), sum(Xtra8), t FROM (
> SELECT cust, ProjFund, Xtra8, coalesce(billdate,bdate) as t FROM
> LSOpenProjects WHERE billdate BETWEEN '2013-01-01' AND '2013-12-31' OR bdate
> BETWEEN '2013-01-01' AND '2013-12-31'
> ) x GROUP BY substr(t,1,7), cust;
>
> -- Darren Duncan

Actually, isn't this more what you want?

SELECT cust, sum(ProjFund), sum(Xtra8), t FROM (
SELECT cust, ProjFund, Xtra8, substr(coalesce(billdate,bdate),1,7) as t FROM
LSOpenProjects WHERE billdate BETWEEN '2013-01-01' AND '2013-12-31' OR bdate
BETWEEN '2013-01-01' AND '2013-12-31'
) x GROUP BY t, cust;

-- Darren Duncan

_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Sorting by month with two dates input

Keith Medcalf

>>I have to create some reporting and I need to report on customers amount1
>>and amount2 two based on the whole year of 2013.  There are two dates that
>>are to be used as input: billdate and bdate.  I can do one or the other,
>>but, I can not seem to get the correct date when using both.  The criteria
>>is that if there is a billdate, that overides the bdate, so the billdate
>>should be the one used and reported on.  If there is no billdate, then,
>>bdate is used.  There is always a bdate as this is the date the project was
>>opened, so all projects have a bdate.  But, not all projects may have a
>>billdate.

>SELECT cust, sum(ProjFund), sum(Xtra8), t FROM (
>SELECT cust, ProjFund, Xtra8, substr(coalesce(billdate,bdate),1,7) as t
>FROM
>LSOpenProjects WHERE billdate BETWEEN '2013-01-01' AND '2013-12-31' OR
>bdate
>BETWEEN '2013-01-01' AND '2013-12-31'
>) x GROUP BY t, cust;

is an improper interpretation of the problem statement.

Based on the problem statement I should think that:

  SELECT cust, sum(ProjFund), sum(Xtra8), reportdate
    FROM (SELECT cust, ProjFund, Xtra8, coalesce(billdate, bdate) as reportdate
            FROM LSOpenProjects
           WHERE strftime('%Y', coalese(billdate, bdate)) = '2013'
         ) as X
GROUP BY strftime('%m', reportdate), cust;

or, equivalently:

  SELECT cust, sum(ProjFund), sum(Xtra8), coalesce(billdate, bdate) as reportdate
    FROM LSOpenProjects
   WHERE strftime('%Y', coalese(billdate, bdate)) = '2013'
GROUP BY strftime('%m', coalese(billdate, bdate)), cust;

is correct.

Proper operation requires that the billdate be NULL or contain a date.  If it was set to an empty or blank string rather than null, then of course the coalesce function will still return the empty or blank string that was stored there rather than the bdate.  If the data store is corrupted in this fashion, then you need to fix it first, and whatever applications caused the corruption of the data in the first place.  

Alternatively you can fix such ill-conceived database contents/design by replacing each use of

coalesce(billdate, bdate) -> CASE WHEN billdate is null or length(rtrim(billdate) < 10)) THEN bdate ELSE billdate END

in which case fixing the broken application(s) and database design will not be required.




_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Sorting by month with two dates input

Stephen Chrzanowski
Untested, but first whack at it;

select * from yourtables order by ifnull(billdate,bdate)

Criteria met:
- A date posted prioritizing billdate and then bdate
- Sorted based on date



On Mon, Sep 1, 2014 at 1:55 AM, Keith Medcalf <[hidden email]> wrote:

>
> >>I have to create some reporting and I need to report on customers amount1
> >>and amount2 two based on the whole year of 2013.  There are two dates
> that
> >>are to be used as input: billdate and bdate.  I can do one or the other,
> >>but, I can not seem to get the correct date when using both.  The
> criteria
> >>is that if there is a billdate, that overides the bdate, so the billdate
> >>should be the one used and reported on.  If there is no billdate, then,
> >>bdate is used.  There is always a bdate as this is the date the project
> was
> >>opened, so all projects have a bdate.  But, not all projects may have a
> >>billdate.
>
> >SELECT cust, sum(ProjFund), sum(Xtra8), t FROM (
> >SELECT cust, ProjFund, Xtra8, substr(coalesce(billdate,bdate),1,7) as t
> >FROM
> >LSOpenProjects WHERE billdate BETWEEN '2013-01-01' AND '2013-12-31' OR
> >bdate
> >BETWEEN '2013-01-01' AND '2013-12-31'
> >) x GROUP BY t, cust;
>
> is an improper interpretation of the problem statement.
>
> Based on the problem statement I should think that:
>
>   SELECT cust, sum(ProjFund), sum(Xtra8), reportdate
>     FROM (SELECT cust, ProjFund, Xtra8, coalesce(billdate, bdate) as
> reportdate
>             FROM LSOpenProjects
>            WHERE strftime('%Y', coalese(billdate, bdate)) = '2013'
>          ) as X
> GROUP BY strftime('%m', reportdate), cust;
>
> or, equivalently:
>
>   SELECT cust, sum(ProjFund), sum(Xtra8), coalesce(billdate, bdate) as
> reportdate
>     FROM LSOpenProjects
>    WHERE strftime('%Y', coalese(billdate, bdate)) = '2013'
> GROUP BY strftime('%m', coalese(billdate, bdate)), cust;
>
> is correct.
>
> Proper operation requires that the billdate be NULL or contain a date.  If
> it was set to an empty or blank string rather than null, then of course the
> coalesce function will still return the empty or blank string that was
> stored there rather than the bdate.  If the data store is corrupted in this
> fashion, then you need to fix it first, and whatever applications caused
> the corruption of the data in the first place.
>
> Alternatively you can fix such ill-conceived database contents/design by
> replacing each use of
>
> coalesce(billdate, bdate) -> CASE WHEN billdate is null or
> length(rtrim(billdate) < 10)) THEN bdate ELSE billdate END
>
> in which case fixing the broken application(s) and database design will
> not be required.
>
>
>
>
> _______________________________________________
> sqlite-users mailing list
> [hidden email]
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Sorting by month with two dates input

jose isaias cabrera
In reply to this post by Darren Duncan

"Darren Duncan" wrote...

> On 2014-08-31, 9:35 PM, Darren Duncan wrote:
>> On 2014-08-31, 9:10 PM, jose isaias cabrera wrote:
>>> SELECT cust, sum(ProjFund), sum(Xtra8), coalesce(billdate,bdate) as t
>>> FROM
>>> LSOpenProjects WHERE billdate BETWEEN '2013-01-01' AND '2013-12-31' OR
>>> bdate
>>> BETWEEN '2013-01-01' AND '2013-12-31' GROUP BY substr(t,1,7), cust;
>>
>> I'm surprised that even compiles, since AFAIK the SELECT clause is
>> evaluated
>> after the GROUP BY clause, and t doesn't exist yet at the GROUP BY stage
>> (unless
>> you have another one in LSOpenProjects).
>>
>> Maybe try using a subquery to force correct evaluation order?
>>
>> Kind of like this:
>>
>> SELECT cust, sum(ProjFund), sum(Xtra8), t FROM (
>> SELECT cust, ProjFund, Xtra8, coalesce(billdate,bdate) as t FROM
>> LSOpenProjects WHERE billdate BETWEEN '2013-01-01' AND '2013-12-31' OR
>> bdate
>> BETWEEN '2013-01-01' AND '2013-12-31'
>> ) x GROUP BY substr(t,1,7), cust;
>>
>> -- Darren Duncan
>
> Actually, isn't this more what you want?
>
> SELECT cust, sum(ProjFund), sum(Xtra8), t FROM (
> SELECT cust, ProjFund, Xtra8, substr(coalesce(billdate,bdate),1,7) as t
> FROM
> LSOpenProjects WHERE billdate BETWEEN '2013-01-01' AND '2013-12-31' OR
> bdate
> BETWEEN '2013-01-01' AND '2013-12-31'
> ) x GROUP BY t, cust;

This one also does the same thing as mine. Hmmm...

_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Sorting by month with two dates input

jose isaias cabrera
In reply to this post by Keith Medcalf
"Keith Medcalf" wrote...

>>>I have to create some reporting and I need to report on customers amount1
>>>and amount2 two based on the whole year of 2013.  There are two dates
>>>that
>>>are to be used as input: billdate and bdate.  I can do one or the other,
>>>but, I can not seem to get the correct date when using both.  The
>>>criteria
>>>is that if there is a billdate, that overides the bdate, so the billdate
>>>should be the one used and reported on.  If there is no billdate, then,
>>>bdate is used.  There is always a bdate as this is the date the project
>>>was
>>>opened, so all projects have a bdate.  But, not all projects may have a
>>>billdate.
>
>>SELECT cust, sum(ProjFund), sum(Xtra8), t FROM (
>>SELECT cust, ProjFund, Xtra8, substr(coalesce(billdate,bdate),1,7) as t
>>FROM
>>LSOpenProjects WHERE billdate BETWEEN '2013-01-01' AND '2013-12-31' OR
>>bdate
>>BETWEEN '2013-01-01' AND '2013-12-31'
>>) x GROUP BY t, cust;
>
> is an improper interpretation of the problem statement.
>
> Based on the problem statement I should think that:
>
>  SELECT cust, sum(ProjFund), sum(Xtra8), reportdate
>    FROM (SELECT cust, ProjFund, Xtra8, coalesce(billdate, bdate) as
> reportdate
>            FROM LSOpenProjects
>           WHERE strftime('%Y', coalese(billdate, bdate)) = '2013'
>         ) as X
> GROUP BY strftime('%m', reportdate), cust;
This one took a long time and did not return anything.
>
> or, equivalently:
>
>  SELECT cust, sum(ProjFund), sum(Xtra8), coalesce(billdate, bdate) as
> reportdate
>    FROM LSOpenProjects
>   WHERE strftime('%Y', coalese(billdate, bdate)) = '2013'
> GROUP BY strftime('%m', coalese(billdate, bdate)), cust;

This one, is looking like a winner.  Thanks.

>
> is correct.
>
> Proper operation requires that the billdate be NULL or contain a date.  If
> it was set to an empty or blank string rather than null, then of course
> the coalesce function will still return the empty or blank string that was
> stored there rather than the bdate.  If the data store is corrupted in
> this fashion, then you need to fix it first, and whatever applications
> caused the corruption of the data in the first place.
>
> Alternatively you can fix such ill-conceived database contents/design by
> replacing each use of
>
> coalesce(billdate, bdate) -> CASE WHEN billdate is null or
> length(rtrim(billdate) < 10)) THEN bdate ELSE billdate END
>
> in which case fixing the broken application(s) and database design will
> not be required.

Thanks for this, but how do I set a value to null?  I thought null and ''
were the same, but now I see it is not.

thanks.

_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Sorting by month with two dates input

jose isaias cabrera
In reply to this post by Stephen Chrzanowski

"Stephen Chrzanowski" wrote...


> Untested, but first whack at it;
>
> select * from yourtables order by ifnull(billdate,bdate)
>
> Criteria met:
> - A date posted prioritizing billdate and then bdate
> - Sorted based on date

yeah, I had tried that before and no cigar... :-)  Thanks, though.

josé

_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Sorting by month with two dates input

Darren Duncan
In reply to this post by jose isaias cabrera
A common logical error that may be affecting you is, do your dates include a
time portion or are they just year-month-day?  If they include a time portion,
then records from Dec 31 likely won't be counted as your 'between' arguments may
be equivalent to '2013-12-31 00:00:00'. -- Darren Duncan

On 2014-09-01, 6:41 PM, jose isaias cabrera wrote:

>
> "Darren Duncan" wrote...
>> On 2014-08-31, 9:35 PM, Darren Duncan wrote:
>>> On 2014-08-31, 9:10 PM, jose isaias cabrera wrote:
>>>> SELECT cust, sum(ProjFund), sum(Xtra8), coalesce(billdate,bdate) as t FROM
>>>> LSOpenProjects WHERE billdate BETWEEN '2013-01-01' AND '2013-12-31' OR bdate
>>>> BETWEEN '2013-01-01' AND '2013-12-31' GROUP BY substr(t,1,7), cust;
>>>
>>> I'm surprised that even compiles, since AFAIK the SELECT clause is evaluated
>>> after the GROUP BY clause, and t doesn't exist yet at the GROUP BY stage (unless
>>> you have another one in LSOpenProjects).
>>>
>>> Maybe try using a subquery to force correct evaluation order?
>>>
>>> Kind of like this:
>>>
>>> SELECT cust, sum(ProjFund), sum(Xtra8), t FROM (
>>> SELECT cust, ProjFund, Xtra8, coalesce(billdate,bdate) as t FROM
>>> LSOpenProjects WHERE billdate BETWEEN '2013-01-01' AND '2013-12-31' OR bdate
>>> BETWEEN '2013-01-01' AND '2013-12-31'
>>> ) x GROUP BY substr(t,1,7), cust;
>>>
>>> -- Darren Duncan
>>
>> Actually, isn't this more what you want?
>>
>> SELECT cust, sum(ProjFund), sum(Xtra8), t FROM (
>> SELECT cust, ProjFund, Xtra8, substr(coalesce(billdate,bdate),1,7) as t FROM
>> LSOpenProjects WHERE billdate BETWEEN '2013-01-01' AND '2013-12-31' OR bdate
>> BETWEEN '2013-01-01' AND '2013-12-31'
>> ) x GROUP BY t, cust;
>
> This one also does the same thing as mine. Hmmm...

_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Sorting by month with two dates input

Darren Duncan
In reply to this post by jose isaias cabrera
On 2014-09-01, 6:50 PM, jose isaias cabrera wrote:
> Thanks for this, but how do I set a value to null?

insert into foo (myfield) values (null);

That's one way.  If you're using some wrapper API, then the host language's
analagy of an undefined value, eg undef in Perl, should do it.

> I thought null and '' were
> the same, but now I see it is not.

Have you used Oracle before?

Oracle treats NULL and '' as the same, but that's a problem with Oracle which
gives its users no end of headaches.

The SQL standard and basically every other SQL DBMS treats NULL as being
distinct from every other value, which is how it is supposed to be.

-- Darren Duncan

_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Sorting by month with two dates input

jose isaias cabrera
In reply to this post by Darren Duncan

"Darren Duncan" wrote...

>A common logical error that may be affecting you is, do your dates include
>a time portion or are they just year-month-day?  If they include a time
>portion, then records from Dec 31 likely won't be counted as your 'between'
>arguments may be equivalent to '2013-12-31 00:00:00'. -- Darren Duncan

No, they are just YYYY-MM-DD.  I think that Igor hit the spot.  It is NULL
vs. ''.

>
> On 2014-09-01, 6:41 PM, jose isaias cabrera wrote:
>>
>> "Darren Duncan" wrote...
>>> On 2014-08-31, 9:35 PM, Darren Duncan wrote:
>>>> On 2014-08-31, 9:10 PM, jose isaias cabrera wrote:
>>>>> SELECT cust, sum(ProjFund), sum(Xtra8), coalesce(billdate,bdate) as t
>>>>> FROM
>>>>> LSOpenProjects WHERE billdate BETWEEN '2013-01-01' AND '2013-12-31' OR
>>>>> bdate
>>>>> BETWEEN '2013-01-01' AND '2013-12-31' GROUP BY substr(t,1,7), cust;
>>>>
>>>> I'm surprised that even compiles, since AFAIK the SELECT clause is
>>>> evaluated
>>>> after the GROUP BY clause, and t doesn't exist yet at the GROUP BY
>>>> stage (unless
>>>> you have another one in LSOpenProjects).
>>>>
>>>> Maybe try using a subquery to force correct evaluation order?
>>>>
>>>> Kind of like this:
>>>>
>>>> SELECT cust, sum(ProjFund), sum(Xtra8), t FROM (
>>>> SELECT cust, ProjFund, Xtra8, coalesce(billdate,bdate) as t FROM
>>>> LSOpenProjects WHERE billdate BETWEEN '2013-01-01' AND '2013-12-31' OR
>>>> bdate
>>>> BETWEEN '2013-01-01' AND '2013-12-31'
>>>> ) x GROUP BY substr(t,1,7), cust;
>>>>
>>>> -- Darren Duncan
>>>
>>> Actually, isn't this more what you want?
>>>
>>> SELECT cust, sum(ProjFund), sum(Xtra8), t FROM (
>>> SELECT cust, ProjFund, Xtra8, substr(coalesce(billdate,bdate),1,7) as t
>>> FROM
>>> LSOpenProjects WHERE billdate BETWEEN '2013-01-01' AND '2013-12-31' OR
>>> bdate
>>> BETWEEN '2013-01-01' AND '2013-12-31'
>>> ) x GROUP BY t, cust;
>>
>> This one also does the same thing as mine. Hmmm...
>
> _______________________________________________
> sqlite-users mailing list
> [hidden email]
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users 

_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Sorting by month with two dates input

jose isaias cabrera
In reply to this post by Darren Duncan

"Darren Duncan" wrote...

> On 2014-09-01, 6:50 PM, jose isaias cabrera wrote:
>> Thanks for this, but how do I set a value to null?
>
> insert into foo (myfield) values (null);
>
> That's one way.  If you're using some wrapper API, then the host
> language's analagy of an undefined value, eg undef in Perl, should do it.
>
>> I thought null and '' were
>> the same, but now I see it is not.
>
> Have you used Oracle before?

Written a few lines here and there, but, that is not where I got it from,
though.  And I agree, NULL and '' is not the same.

>
> Oracle treats NULL and '' as the same, but that's a problem with Oracle
> which gives its users no end of headaches.
>
> The SQL standard and basically every other SQL DBMS treats NULL as being
> distinct from every other value, which is how it is supposed to be.
>
> -- Darren Duncan
>
> _______________________________________________
> sqlite-users mailing list
> [hidden email]
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users 

_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Sorting by month with two dates input

Keith Medcalf
In reply to this post by jose isaias cabrera

update LSOpenProjects
   set billdate = null
 where len(rtrim(billdate)) < 10;

>Thanks for this, but how do I set a value to null?  I thought null and ''
>were the same, but now I see it is not.

'' means that "the value is an empty string" whereas null means there is no value/the value is unknown/the value is not determined yet.

You can "fix" all your dates by doing an:

update <table>
   set <datefield> = <contentfunction>(julianday(<datefield));

where <contentfunction> is one of date time or datetime depending on whether the <datefield> is supposed to contain a date, time, or datetime respectively.  The date will be normalized but the result will be null if the field is blank or contains a time outside the 00:00:00 - 23:59:59 valid time strings.




_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users