Click here to Skip to main content
15,902,874 members
Home / Discussions / Database
   

Database

 
GeneralRe: update a dataBase Table with a dataSet Table Pin
cosmindp18-Jul-06 8:46
cosmindp18-Jul-06 8:46 
QuestionDataGrids counter Pin
hamidreza_buddy18-Jul-06 6:55
hamidreza_buddy18-Jul-06 6:55 
AnswerRe: DataGrids counter Pin
Paul Conrad18-Jul-06 11:20
professionalPaul Conrad18-Jul-06 11:20 
QuestionBulk insertion of data in sql server Pin
montu337718-Jul-06 5:32
montu337718-Jul-06 5:32 
AnswerRe: Bulk insertion of data in sql server Pin
sampathkumarg19-Jul-06 8:31
sampathkumarg19-Jul-06 8:31 
QuestionHow to find consecutive days without weekends or holidays? Pin
lsugirljte18-Jul-06 5:32
lsugirljte18-Jul-06 5:32 
AnswerRe: How to find consecutive days without weekends or holidays? Pin
Eric Dahlvang19-Jul-06 8:25
Eric Dahlvang19-Jul-06 8:25 
AnswerRe: How to find consecutive days without weekends or holidays? Pin
Michael Potter19-Jul-06 9:59
Michael Potter19-Jul-06 9:59 
Nasty requirements - here is a first attempt using a cursor. I think I would change the EndDate calculation to a function so that you could remove the cursor.
DECLARE @StartDate DATETIME
DECLARE @EndDate DATETIME
DECLARE @cnt INTEGER
 
DECLARE cur CURSOR FOR 
    SELECT
        AbsentDate 
    FROM 
        #tmpTable
 
OPEN cur
 
FETCH NEXT FROM cur INTO @StartDate
WHILE @@FETCH_STATUS = 0
BEGIN
    SET @cnt = 0
    SET @EndDate = @StartDate
    WHILE @cnt < 6
    BEGIN
        SET @cnt = @cnt + 1
        SET @EndDate = DATEADD(d,1,@EndDate)
        WHILE (DATEPART(dw,@EndDate) IN (1,7)) OR
              (EXISTS(SELECT * FROM Holidays 
                      WHERE HolidayDate = @EndDate))
        BEGIN
            SET @EndDate = DATEADD(d,1,@EndDate)
        END
    END	
 
    IF ((SELECT COUNT(*) 
         FROM #tmpTable
         WHERE AbsentDate BETWEEN @StartDate AND @EndDate) > 5)
    BEGIN
        -- Save Date
        -- or do other desired processing
    END
 
    FETCH NEXT FROM cur INTO @StartDate
END
 
CLOSE cur
DEALLOCATE cur

QuestionField size confusion Pin
Brendan Vogt18-Jul-06 4:07
Brendan Vogt18-Jul-06 4:07 
AnswerRe: Field size confusion Pin
Paddy Boyd18-Jul-06 4:29
Paddy Boyd18-Jul-06 4:29 
AnswerRe: Field size confusion Pin
Michael Potter18-Jul-06 4:31
Michael Potter18-Jul-06 4:31 
QuestionSQl Express or Everywhere Pin
Gilad Kapelushnik18-Jul-06 3:34
Gilad Kapelushnik18-Jul-06 3:34 
AnswerRe: SQl Express or Everywhere Pin
Colin Angus Mackay18-Jul-06 3:58
Colin Angus Mackay18-Jul-06 3:58 
GeneralRe: SQl Express or Everywhere Pin
Gilad Kapelushnik18-Jul-06 4:12
Gilad Kapelushnik18-Jul-06 4:12 
AnswerRe: SQl Express or Everywhere Pin
Mike Dimmick18-Jul-06 7:20
Mike Dimmick18-Jul-06 7:20 
GeneralRe: SQl Express or Everywhere Pin
Gilad Kapelushnik18-Jul-06 7:50
Gilad Kapelushnik18-Jul-06 7:50 
GeneralRe: SQl Express or Everywhere Pin
Not Active18-Jul-06 8:37
mentorNot Active18-Jul-06 8:37 
QuestionLicensing? Pin
PaulInglis18-Jul-06 0:55
PaulInglis18-Jul-06 0:55 
AnswerRe: Licensing? Pin
Mike Dimmick18-Jul-06 2:10
Mike Dimmick18-Jul-06 2:10 
QuestionRemote Microsoft Access Pin
bahamutnice17-Jul-06 22:00
bahamutnice17-Jul-06 22:00 
AnswerRe: Remote Microsoft Access Pin
Frank Kerrigan17-Jul-06 22:19
Frank Kerrigan17-Jul-06 22:19 
AnswerRe: Remote Microsoft Access Pin
bahamutnice18-Jul-06 23:04
bahamutnice18-Jul-06 23:04 
GeneralRe: Remote Microsoft Access Pin
Rob Graham19-Jul-06 10:16
Rob Graham19-Jul-06 10:16 
AnswerRe: Remote Microsoft Access Pin
S Douglas23-Jul-06 21:10
professionalS Douglas23-Jul-06 21:10 
Questionhow to call stored procedure from a report? Pin
cellardoor071617-Jul-06 21:40
cellardoor071617-Jul-06 21:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.