Sorry about that, here's the tableCREATE TABLE [dbo].[Timecards] ( [TimecardID] [int] IDENTITY (1, 1) NOT NULL , [ProjectID] [int] NOT NULL , [PersonID] [int] NOT NULL , [TimecardDate] [smalldatetime] NOT NULL , [TimecardHours] [decimal](7, 2) NOT NULL ) ON [PRIMARY]GO
I then have a sproc to insert values, that also sums up hours for like projects, so if someone enters 1 hours at the start of the day, and 1 hour at the end, it results in 1 record of two hours for that day/project and not two records of 1 hour each. Here's that sprocCREATE PROCEDURE Timecards_INS@ProjectID int,@PersonID int,@TimecardDate smalldatetime,@TimecardHours decimal(3,2)ASIF EXISTS ( SELECT TimecardID FROM Timecards WHERE (ProjectID = @ProjectID) AND (PersonID = @PersonID) AND (TimecardDate = @TimecardDate) ) BEGIN UPDATE Timecards SET TimecardHours = TimecardHours + @TimecardHours WHERE (ProjectID = @ProjectID) AND (PersonID = @PersonID) AND (TimecardDate = @TimecardDate) ENDELSE BEGIN INSERT INTO Timecards (ProjectID, PersonID, TimecardDate, TimecardHours) VALUES (@ProjectID, @PersonID, @TimecardDate, @TimecardHours) ENDGO