And even if there was an "end of month" modifier, your expression would screw 
up more than half the time

Lets take a date in march, eg. The 15th

2013-03-15 -> (end of month) -> 2013-03-31 -> (-1 month) -> 2013-02-31 -> 
(renormalization) -> 2013-03-03

-----Ursprüngliche Nachricht-----
Von: Simon Davies [mailto:simon.james.dav...@gmail.com]
Gesendet: Donnerstag, 12. September 2013 15:01
An: General Discussion of SQLite Database
Betreff: Re: [sqlite] Select with dates

On 12 September 2013 06:34, jwzumwalt <jwzumw...@gmail.com> wrote:
> I have not used the date function in select statements before.
> I have valid entries for the current month, what am I doing wrong?
>
> SELECT * FROM "entry" WHERE
>             bankdate > date('now','end of month','-1 month')
>             AND bankdate < date('now','start of month','+1 month')
>

I see no "end of month" modifier in http://www.sqlite.org/lang_datefunc.html
Why not
    SELECT * FROM "entry" WHERE
           bankdate >= date('now','start of month')
          AND bankdate < date('now','start of month','+1 month')

Regards,
Simon
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


--------------------------------------------------------------------------
 Gunter Hick
Software Engineer
Scientific Games International GmbH
Klitschgasse 2 – 4, A - 1130 Vienna, Austria
FN 157284 a, HG Wien
Tel: +43 1 80100 0
E-Mail: h...@scigames.at

This e-mail is confidential and may well also be legally privileged. If you 
have received it in error, you are on notice as to its status and accordingly 
please notify us immediately by reply e-mail and then delete this message from 
your system. Please do not copy it or use it for any purposes, or disclose its 
contents to any person as to do so could be a breach of confidence. Thank you 
for your cooperation.
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to