I would like to retrieve records between time spans,All i have is this snippet of string indicating the time span
9:00 AM - 10:00 AM
below is the table schema
CREATE TABLE [dbo].[Samples](
[RID] [int] IDENTITY(1,1) NOT NULL,
[PersonName[nvarchar](20) NOT NULL,
[NOT_AVL_DATE] [datetime] NULL,
[NOT_AVL_FOR] [int] NULL
)
brief:
Rid is Primary key, PersonName is Employee/Staff/Technician Name, NOT_AVL_Date is the datetime the staff wont be avilable, NOT_AVL_FOR represents time span the staff wont be avilable.
1 – Leave for Full day
2- Leave for First half of the day
3 – Leave for Second half of the day
Requirement:
Given timeSpan i want the Staff who are not on leave for that time span. Could someone construct a Full Statement , my head is whirling thinking about this..thanks for any help
Best Answer
Deeptechtons, we really would like to see your answer, but since you haven't posted it yet, here is how it could be done. This SQL is for Oracle not SQL Server, so it would have to be translated. There are details missing from your post, so some assumptions used are likely invalid.
Sample data: