Viewing 13 posts - 1 through 13 (of 13 total)
Hi Peter.
I'm on vacation the next two days but I'll try it on monday.
Your solution looks great and simple and I ask myself why this didn't come to my mind....
December 14, 2011 at 11:20 am
Exactly: the date was the problem. Sorry for not coming back.
Since I found this out, I always write dates in the format frfernan suggested because it is language independent.
E.g.: 14th...
May 6, 2011 at 9:10 am
Hi.
After searching the internet again I stumbled upon this article which contains a nice overview of dateformats and their dependencies from the language setting:
http://www.karaszi.com/SQLServer/info_datetime.asp
I changed the assignment to:
DECLARE @startdate DATETIME
SET...
September 23, 2010 at 3:37 am
I'll give it a try on monday, thank you Jeffrey.
Steffen
July 10, 2010 at 6:04 pm
Hi,
another approach would be to convert the year and month values to an int which can be compared and sorted like this:
SELECT d.CLACCT
FROM
(
SELECT CLACCT,YEAR*100 + MONTH AS YEARMONTH as mydate
FROM...
May 26, 2010 at 3:26 am
Hi Jon,
no, NextResult() would fetch the next resultset if you would execute 2 querys in a batch, e.g.
SELECT 1 AS test;
SELECT 2 AS test;
To move to the next record in...
May 12, 2010 at 3:08 pm
Shouldn't the NULLIF be around the @Path variable?
UPDATE m
SET
Path = ISNULL(NULLIF(@Path,''),m.path), -- don't update when no path supplied
PathReadOnly = ISNULL(@PathReadOnly,m.PathReadOnly)
FROM dbo.Mytable as m
WHERE Code = @Code...
May 12, 2010 at 4:59 am
Hi,
I believe this should work, but it is untested because you provided no sample data. 🙂
CREATE PROCEDURE dbo.SP_Template
@Code char(30),
@Path varchar(100) = null,
@PathReadOnly int = null
AS
BEGIN
--set @path = null if it...
May 12, 2010 at 4:22 am
shadow_2 (5/12/2010)
Hi,
SELECT RIGHT('0' + CAST(datepart (week, '2005-01-01') AS VARCHAR(2)),2)
should work. I'm just putting a zero in front and then take 2 places from the right.
Steffen.
Sorry, I overlooked that you want...
May 12, 2010 at 3:20 am
Hi,
SELECT RIGHT('0' + CAST(datepart (week, '2005-01-01') AS VARCHAR(2)),2)
should work. I'm just putting a zero in front and then take 2 places from the right.
Steffen.
May 12, 2010 at 2:57 am
Hi Ken,
your second query is exactly what I was looking for.
In my tries I always sorted by date ascending and ran into the problem not to know which row_number()...
May 11, 2010 at 4:52 am
cfradenburg (4/20/2010)
And do you know no rows were deleted...
April 21, 2010 at 12:59 am
Hi.
Thanks for this, I usually use the IN-clause because it's easier to check which records will be deleted and in addition I didn't know one could do it the way...
April 19, 2010 at 1:00 am
Viewing 13 posts - 1 through 13 (of 13 total)