Viewing 15 posts - 826 through 840 (of 2,452 total)
try a search on this site ....plenty of q/a's
GOOGLE> site:http://www.sqlservercentral.com add working days
April 7, 2016 at 1:39 pm
K430 (4/7/2016)
Thanks for the reply, I need it to add working days, skipping weekends
so...other than weekends, what other days do you wish to skip...for example public holidays?
April 7, 2016 at 1:36 pm
maybe....
SELECT CharField,
DateField,
CASE
WHEN CharField = 'A' then dateadd(day,14, datefield)
WHEN CharField = 'B' ......... else NULL end as yournewdate
FROM ...
April 7, 2016 at 12:33 pm
Ed Wagner (4/6/2016)
Alan.B (4/6/2016)
Luis Cazares (4/6/2016)
Ed Wagner (4/6/2016)
Iwas Bornready (4/6/2016)
This is great. I didn't know this simple trick.This is a QOTD that's 3 1/2 years old.
And this functionality is no...
April 6, 2016 at 10:18 am
ChrisM@Work (4/6/2016)
J Livingston SQL (4/6/2016)
would be appreciated if the OP would reply, rather than logging on and not making any further comment.heyho!
Counting patterns of unexpected behaviour in a certain order,...
April 6, 2016 at 10:10 am
would be appreciated if the OP would reply, rather than logging on and not making any further comment.
heyho!
April 6, 2016 at 9:44 am
what is the data type of "week"?
maybe if "week" is varchar then
ORDER BY cast(week as int) DESC
April 5, 2016 at 10:09 am
as a starter.....given the following what results would you expect?
if this isnt a basic interpretation of your table, then please post a representative script that does explain your table structure
USE...
April 4, 2016 at 8:08 am
pbo71465 (4/3/2016)
I'm just looking for the logic to count patterns of action in a sequence.
If you're not aware of any, then thanks for your contribution.
I'm thinking someone has come...
April 4, 2016 at 2:52 am
curious_sqldba (4/1/2016)
DBName ...
April 2, 2016 at 3:38 am
Jacob Wilkins (4/1/2016)
DECLARE @dt datetime;
SET @dt='20160331 14:38:25';
SELECT date_from=DATEADD(mi,(((DATEDIFF(mi,0,@dt)/30)-2)*30),0),
date_to= DATEADD(ss,-1,DATEADD(mi,(((DATEDIFF(mi,0,@dt)/30)-1)*30),0));
SET @dt='20160401 12:02:25';
SELECT date_from=DATEADD(mi,(((DATEDIFF(mi,0,@dt)/30)-2)*30),0),
...
April 1, 2016 at 7:03 am
bit convoluted.....may be easier ways
SELECT thedate,
CAST(LEFT( DATEADD(hour,-1, DATEADD(minute, -DATEPART(minute, thedate) % 30, thedate)), 19) AS DATETIME) AS dtFrom,
...
April 1, 2016 at 6:46 am
maybe a few ideas to get you started
SELECT thedate,
DATENAME(dw, thedate),
DATEADD(wk, DATEDIFF(wk, 0, DATEADD(dd, -1, thedate)), 0)...
April 1, 2016 at 4:25 am
still waiting for some sample scripts....are these on the way?
does your "sales" table have multiple entries for same employee? (I am guessing yes??)
March 31, 2016 at 12:11 pm
Viewing 15 posts - 826 through 840 (of 2,452 total)