without disagreeing with any of the above, I got bit by having a "list of holidays" table yesterday.
We have a table, unimaginatively called ms_holiday.
The structure is similar to
CREATE TABLE [dbo].[MS_Holiday] (
[Holiday_Depot_No] [varchar] (7) COLLATE Latin1_General_CI_AI NOT NULL ,
[Holiday_Dt] [datetime] NOT NULL ,
[Holiday_Desc] [varchar] (40) COLLATE Latin1_General_CI_AI NOT NULL
) ON [SECONDARY]
(I snipped out the created_by, created_date, constraints etc.).
This stores holidays for each depot in our organization, so we could store Western Easter dates at out London depots, and Orthodox Easter dates at our Greek(?) Depots . 😉
But it breaks down when we add new depots and forget to populate the table with the new depots and their corresponding dates! [Yes, it was me, guilty as charged... :blush:]
Therefore working things out on the fly for the times that these functions are called sounds a better bet for me.
Mind you, I could always go and beat up the developers of the app until they write a complete add new depot screen. (There are so many hacks I weep, regularly :()
Dave J
Edited: Took out a typo or two. How come you never spot them in the preview, only after post?