Re: How to store opening time of shops?
Date: Mon, 18 Mar 2019 14:41:38 +0100
Message-ID: <q6o76h$16es$1_at_gioia.aioe.org>
> It is possible for a shop to open and close many different times on one
> day and many different days so it terms of reducing it, it make be that
> there is no general solution that can be applied.
Yes, I understood it...
> The most generaic solutin to such a thing is to use your shop ID as a
> key, and have a table of ALL its possible opening times pointing to that
> key, so one shop->many opening times.
Yes, I have the same idea and it's something like Tony said in his reply!
> In order to see which one applies, you may need to have a compex
> 'opening times' table, to accomodate the fact that on the 27th July
> 2019 the shop will be losed betwee 3pm and 6pm (for a funeral)
You got the point, this it'll be the perfect solution but I think I should store something like it in a field named notes I mean I don't know if it could be a good idea to change opening times values on a particular day, it's more easy to write a note!
> So you would then need an algorithm tha, for a given day, looks to see
> if there is a particulatr entry and if not, if there is a generic entry
> for the month date, date, day of week and so on.
>
> And give them precedence.
Yes of course an algorithm could be the best solution but I think, like what I wrote above, it could be a good idea also to add a note field for special opened/closed days...
> Or perhaps stire thge general case in the store table and then store the
> exceptions elsewhere.
Yes, this is my idea or it's better to say it's the easiest solution! :)
^Bart Received on Mon Mar 18 2019 - 14:41:38 CET