Click here to Skip to main content
15,890,995 members
Home / Discussions / Database
   

Database

 
QuestionNumber of weekdays between to dates Pin
szukuro13-Mar-07 1:44
szukuro13-Mar-07 1:44 
AnswerRe: Number of weekdays between to dates Pin
Harini N K13-Mar-07 1:57
Harini N K13-Mar-07 1:57 
GeneralRe: Number of weekdays between to dates [modified] Pin
szukuro13-Mar-07 2:32
szukuro13-Mar-07 2:32 
AnswerRe: Number of weekdays between to dates Pin
szukuro13-Mar-07 5:15
szukuro13-Mar-07 5:15 
GeneralRe: Number of weekdays between to dates Pin
Harini N K13-Mar-07 18:27
Harini N K13-Mar-07 18:27 
GeneralRe: Number of weekdays between to dates Pin
szukuro13-Mar-07 22:29
szukuro13-Mar-07 22:29 
GeneralRe: Number of weekdays between to dates [modified] Pin
Harini N K13-Mar-07 23:46
Harini N K13-Mar-07 23:46 
GeneralRe: Number of weekdays between to dates Pin
szukuro14-Mar-07 0:38
szukuro14-Mar-07 0:38 
Actually that's very similiar to what I came up with rewriting my own code in SQL. Mine's:
CREATE FUNCTION WeekDaysBetween
(
@from datetime,
@to datetime
)
AS
BEGIN
DECLARE @num int
SET @num = 0
WHILE (DATEDIFF(day, @from, @to) > 0)
BEGIN
   DECLARE @day int
   SET @day = DATEPART(dw, @from)
   IF (@day > 1 AND @day < 7)
	SET @num = @num + 1
   SET @from = DATEADD(day,1 , @from)
END
RETURN @num
END

This seems to work. Thanks for your help though.
GeneralRe: Number of weekdays between to dates [modified] Pin
Avatto13-Jan-14 3:51
Avatto13-Jan-14 3:51 
QuestionHow to pass parameters to Sub Report from Main Report ? Pin
prakash_21013-Mar-07 1:36
prakash_21013-Mar-07 1:36 
Questionwhere the database is located? Pin
senthil_rajesh_kavin13-Mar-07 0:04
senthil_rajesh_kavin13-Mar-07 0:04 
AnswerRe: where the database is located? Pin
Harini N K13-Mar-07 0:29
Harini N K13-Mar-07 0:29 
GeneralRe: where the database is located? Pin
Colin Angus Mackay13-Mar-07 0:53
Colin Angus Mackay13-Mar-07 0:53 
AnswerRe: where the database is located? Pin
Colin Angus Mackay13-Mar-07 0:52
Colin Angus Mackay13-Mar-07 0:52 
GeneralRe: where the database is located? Pin
kaliem13-Mar-07 21:54
kaliem13-Mar-07 21:54 
GeneralRe: where the database is located? Pin
Colin Angus Mackay13-Mar-07 22:01
Colin Angus Mackay13-Mar-07 22:01 
GeneralRe: where the database is located? Pin
kaliem13-Mar-07 22:17
kaliem13-Mar-07 22:17 
GeneralRe: where the database is located? Pin
Colin Angus Mackay13-Mar-07 22:19
Colin Angus Mackay13-Mar-07 22:19 
Questiongive me server objects... Pin
Renuka Reddy12-Mar-07 18:07
Renuka Reddy12-Mar-07 18:07 
AnswerRe: give me server objects... Pin
Colin Angus Mackay13-Mar-07 0:55
Colin Angus Mackay13-Mar-07 0:55 
QuestionSyntax's Pin
Renuka Reddy12-Mar-07 18:02
Renuka Reddy12-Mar-07 18:02 
AnswerRe: Syntax's Pin
Colin Angus Mackay13-Mar-07 0:59
Colin Angus Mackay13-Mar-07 0:59 
QuestionADO and Cyrillic text Pin
langley11112-Mar-07 11:15
langley11112-Mar-07 11:15 
QuestionSearch index Pin
N a v a n e e t h12-Mar-07 5:34
N a v a n e e t h12-Mar-07 5:34 
QuestionMultiple values in stored proc parameter Pin
GaryWoodfine 12-Mar-07 5:22
professionalGaryWoodfine 12-Mar-07 5:22 

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.