Hi Ryan,

2018-04-12 17:36 GMT+02:00 R Smith <ryansmit...@gmail.com>:
> On 2018/04/12 5:20 PM, Csányi Pál wrote:
>>
>> Yes, this is what I am asking.
>>
>> 2018-04-12 17:17 GMT+02:00 Keith Medcalf <kmedc...@dessus.com>:
>>>
>>> Which seems like a rather long winded way of stating the problem:
>>> "I have a table with a bunch-o-dates in it.  I want a query which will
>>> return, at the time the query is run, based on the comuter on which the
>>> query is run concept of today's date, today's date, if that date is in the
>>> table otherwise the tomorrow's date (based on the current concept of
>>> 'tomorrow' on the computer on which the query is run."
>>>
>>> Is this what you are asking?
>
>
> Ok, now that we know what you are asking, there are some ways of doing it
> easily, of which Richard's way will work perfectly.
>
> But, some more information will be useful:
> - Can there be dates later than today in the table or not?
> - Can there be multiple dates for today in the table, or just the one?
> - Do you need to run this query often, or is it used simply to determine the
> next date available for another query (insert perhaps)?
>
> I'm asking because I feel like the query you are asking for is achieving
> something as part of a larger query or group of functions that may all be
> made simpler. I could of course be wrong, but if you'd like to find out,
> post the whole schema and method you are trying to make and we could suggest
> what might work the fastest/easiest/best - or we might at least confirm that
> you are already doing it the best way.
>
> Cheers!
> Ryan

> - Can there be dates later than today in the table or not?
Yes, it can.

> - Can there be multiple dates for today in the table, or just the one?
Yes, it can.

> - Do you need to run this query often, or is it used simply to determine the
> next date available for another query (insert perhaps)?
It is used simply to determine the next date available for another query.

> I'm asking because I feel like the query you are asking for is achieving
> something as part of a larger query or group of functions that may all be
> made simpler. I could of course be wrong, but if you'd like to find out,
> post the whole schema and method you are trying to make and we could suggest
> what might work the fastest/easiest/best - or we might at least confirm that
> you are already doing it the best way.

You're right.
I am developing an Android app on App Inventor2.
The app is in Hungarian language so the SQLite database contains
tables and columns with Hungarian names.

The whole schema is like this:
CREATE TABLE Beiratkozottak(
  az INTEGER PRIMARY KEY UNIQUE,
  TanuloNeve TEXT NOT NULL,
  EvFolyam INTEGER NOT NULL,
  Tagozat TEXT NOT NULL
);
CREATE TABLE Hianyzok(
  az INTEGER PRIMARY KEY,
  HianyzoTanulo TEXT NOT NULL,
  Orak INTEGER REFERENCES Orak(az) NOT NULL
);
CREATE TABLE JelenLevok(
  az INTEGER PRIMARY KEY UNIQUE,
  JelenLevoTanulo TEXT NOT NULL,
  Orak INTEGER REFERENCES Orak(az) NOT NULL
);
CREATE TABLE Orak(
  az INTEGER PRIMARY KEY UNIQUE,
  Keltezes DATE DEFAULT NULL,
  OrarendNapja TEXT DEFAULT NULL,
  BlokkoraSzama TEXT DEFAULT NULL,
  EvFolyam INTEGER DEFAULT NULL,
  Tagozat TEXT DEFAULT NULL,
  OraVazlat TEXT DEFAULT NULL,
  OraNaplo TEXT DEFAULT NULL,
  Emlekezteto TEXT DEFAULT NULL,
  OraRend INTEGER REFERENCES OraRend(az) DEFAULT NULL,
  Beiratkozottak INTEGER REFERENCES Beiratkozottak(az) DEFAULT NULL,
  TanSzombatokOraRendjei INTEGER REFERENCES TanSzombatokOraRendjei(az)
DEFAULT NULL,
  KivetelesNapokOraRendjei INTEGER REFERENCES
KivetelesNapokOraRendjei(az) DEFAULT NULL
);
CREATE TABLE OraRend(
  az INTEGER PRIMARY KEY UNIQUE,
  aHetNapja TEXT,
  HanyadikIskolaOra INTEGER,
  EvFolyam INTEGER,
  Tagozat TEXT
);
CREATE TABLE TanSzombatokOraRendjei(
  az INTEGER PRIMARY KEY UNIQUE,
  Keltezes DATE DEFAULT NULL,
  aHetNapja TEXT
);
CREATE TABLE KivetelesNapokOraRendjei(
  az INTEGER PRIMARY KEY UNIQUE,
  Keltezes DATE DEFAULT NULL,
  aHetNapja TEXT
);

There are datas already in this database.
The Orak table contains dates on which we have school, that is teaching.
That mean not every day in the year is a school day.
The OraRend table contains the timetable.

So when I start the android app on my phone it should display the
school day at that day, or, if on that day we have not a schoolday,
then to display the next school day from the Orak table.
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to