RE: SQL Business Dates

2001-03-30 Thread Philip Arnold - ASP
> SQL Server can handle that... > > DATEPART(datepart, date) > The weekday (dw) datepart returns a number that corresponds to the day of > the week, for example: Sunday = 1, Saturday = 7. The number > produced by the > weekday datepart depends on the value set by SET DATEFIRST, which sets the > fi

RE: [RE: SQL Business Dates]

2001-03-29 Thread bflynn
h 27, 2001 3:15 PM To: CF-Talk Subject: Re: [RE: SQL Business Dates] thanks but dateasgn and datecomp will always be a business date. the difference between them is the problem nights and weekends get included. Question: Can I write a function in SQLServer like in PLSQL and call that function fro

Re: [RE: SQL Business Dates]

2001-03-27 Thread Alex
thanks but dateasgn and datecomp will always be a business date. the difference between them is the problem nights and weekends get included. Question: Can I write a function in SQLServer like in PLSQL and call that function from within an SQL query? "Hayes, David" <[EMAIL PROTECTED]> wrote: Loo

RE: SQL Business Dates

2001-03-27 Thread Russ Conway
SQL Server can handle that... DATEPART(datepart, date) The weekday (dw) datepart returns a number that corresponds to the day of the week, for example: Sunday = 1, Saturday = 7. The number produced by the weekday datepart depends on the value set by SET DATEFIRST, which sets the first day of the

RE: SQL Business Dates

2001-03-27 Thread Derek Havelock
Can you slip in Your code here ... Your alternative code here ... just a thought ... Derek IT Star Web Design, Hosting, Database Integration and Internet Marketing http://www.itstar.co.uk/ [EMAIL PROTECTED] -Original Message- From: Alex [mailto:[EMAIL PROTECTED]] Sent: 27 March 200

RE: SQL Business Dates

2001-03-27 Thread bflynn
Every time I've seen this come up, the solution is a combination of finesse and outright hacking. Basic solution - Count the number of days between the two dates. If the startdate and enddate are in M-F, that count DIV 7 will tell you how many weeks there were, so subtract the number of weeks

RE: SQL Business Dates

2001-03-27 Thread Hayes, David
Look at the DATEPART function. -Original Message- From: Alex [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 27, 2001 1:31 PM To: CF-Talk Subject: SQL Business Dates I have a query ... SELECT AVG(DATEDIFF(minute, dateasgn, datecomp)) AS diff FROM tblprob WHERE pr