You're asking for "ELSE date('now','+1 day')" which is 2018-04-13 which is what you're getting, no?
On 4/12/18, 9:47 AM, "sqlite-users on behalf of Csányi Pál" <sqlite-users-boun...@mailinglists.sqlite.org on behalf of csanyi...@gmail.com> wrote: Hi Simon, 2018-04-12 14:32 GMT+02:00 Simon Slavin <slav...@bigfraud.org>: > On 12 Apr 2018, at 1:25pm, Csányi Pál <csanyi...@gmail.com> wrote: > >> SELECT CASE TheDate = date('now') WHEN TheDate ... > > I don't think that's what you wanted. Perhaps > > SELECT CASE TheDate WHEN date('now') ... > > But you should test the output of "date('now')" to make sure it is in the format you want. The output of "date('now') is in format I want: SELECT date('now'); 2018-04-12 I tried this: SELECT CASE TheDate WHEN date('now') THEN TheDate ELSE date('now','+1 day') END TheDate FROM Dates; 2018-04-13 2018-04-13 2018-04-13 2018-04-13 2018-04-13 2018-04-13 2018-04-13 2018-04-13 2018-04-13 2018-04-13 2018-04-13 2018-04-12 2018-04-13 2018-04-13 2018-04-13 but I expect the output like this: 2018-04-12 because today date is: 2018-04-12 What am I missing here? -- Best, Pali _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users