Viewing 15 posts - 421 through 435 (of 3,543 total)
Notwithstanding the above comments, I think using a static datetime value would have been better to remove ambiguity.
Also there is no mention in the answer of the datatype precedence in...
August 30, 2016 at 6:40 am
Check
and
August 25, 2016 at 1:58 am
Jeff Moden (8/18/2016)
August 19, 2016 at 2:27 am
Luis Cazares (8/9/2016)
August 9, 2016 at 8:25 am
Tallboy (8/9/2016)
Hi David,That is exactly what I was looking for...
I wonder tho can it be done recursively!
kind regards
WITH
cte (MonthEnd)
...
August 9, 2016 at 7:33 am
Y.B. (8/9/2016)
David Burrows (8/9/2016)
SELECT DATEADD(week,Weeks,@StartDate) AS [MonthEnd]
FROM (VALUES (0),(4),(8),(12),(16),(20),(24),(28),(32),(36),(40),(44),(48),(32)) w (Weeks)
Hi David,
I think you have a typo in your values...shouldn't that 32 at the end be a 52?...
August 9, 2016 at 7:18 am
SELECT DATEADD(week,Weeks,@StartDate) AS [MonthEnd]
FROM (VALUES (0),(4),(8),(12),(16),(20),(24),(28),(32),(36),(40),(44),(48),(52)) w (Weeks)
August 9, 2016 at 6:22 am
SELECT T.ID1,
CAST(T.[StartDate] AS DATE) TaskStartDate,
MAX(CASE WHEN DATEDIFF(DAY, getdate(), T.[StartDate]) > 0 THEN ROUND(0 ,3)
...
August 8, 2016 at 6:58 am
John Mitchell-245523 (8/2/2016)
...Be careful if you have any non-leading "-"s that you want to keep, though.
SUBSTRING([column],PATINDEX('%[^-]%',[column]),255)
August 2, 2016 at 6:51 am
Grant Fritchey (6/3/2016)
June 3, 2016 at 6:29 am
R.P.Rozema (6/1/2016)
It may look easy, but still the solution provided was wrong.
If you replace DateAndTime with Value in the ORDER BY, it will be correct 🙂
June 1, 2016 at 7:47 am
Sean Lange (6/1/2016)
You can do this easily using TOP.
Too easy when you give the answer 😛
Mind you it's what I normally do 😀
June 1, 2016 at 7:23 am
Use
WHERE to filter the data
ORDER BY to put the data in the required order
TOP to restrict the output to one row
Post what you have so far and someone will help
June 1, 2016 at 7:17 am
Luis Cazares (5/31/2016)
Is SQL Fertilization the reason we have so much code and practices that look like feces?
In the beginning there was SQL Server.
God said 'Let there be light'.
Click!
And there...
May 31, 2016 at 10:51 am
You need to wrap the subquery with another select and use FOR XML
like this
DECLARE @rssbody XML;
SET @rssbody = (
SELECT FLDB,PROC_SET_CODE,PROC_SET_NAME FROM (
SELECT 'Fl01' as FLDB, PROC_SET_CODE, PROC_SET_NAME
FROM [Fl01].[dbo].[PRSM]
WHERE PROC_SET_CODE...
May 25, 2016 at 10:35 am
Viewing 15 posts - 421 through 435 (of 3,543 total)