From my original;



*Take for instance - using today as the base date, a date of Aug 1, 2016
with a yearly recurring date, I'd like to get Aug 1, 2018.- using today as
the base date, a date of Aug 1, 2016 with a weekly recurring date, I'd like
to get Sept 2, 2017.*
Today being Sept 27, 2017.
Aug 1, 2016 is a Monday
Aug 1, 2018 is a Wed, so week day change is valid. (Aug 1, 2017 is in the
past)
Sept 2, 2017 should have been Oct 2, 2017.  My bad.  The result I'd want is
Oct 2, 2017 which is a Monday.  I should have caught that, since Sept 2 is
in the past and I want the result to be >= Today.

The purpose of this is that I've built a calendar system at home, and I'm
tired of going into the history and reset birthdays to be visible, as well
as regular weekly events for my sons guitar lessons having to be recreated
regularly.  Either via PHP code or (very nicely done) SQL code by David,
which I've yet to test and build into my web page, needs to be built in.
With a single additional field to the table that indicates Daily, Weekly,
Monthly or Yearly (Maybe 2xWeek, 3xWeek, 4xWeek now that I have some hints
to what to do), and minimal change to the 'add date' page, this should help.

Thanks all.

On Wed, Sep 27, 2017 at 10:34 AM, Donald Griggs <[email protected]> wrote:

> Hello Stephen,
> I'm not sure I understand.   If I run:
>     select julianday(  '2017-09-02') - julianday('2016-08-01');
> I get a difference of 397 days, which equals  56 weeks and 5 days -- not
> evenly divisible by 7.
>
> select 397.0 / 7;   -- gives 56.714...
> select 397.0 % 7; -- gives 5
>
> >
> >
> _______________________________________________
> sqlite-users mailing list
> [email protected]
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
[email protected]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to