Viewing 15 posts - 601 through 615 (of 1,923 total)
Totally possible if you have a calendar table designed for your needs. Else we need to play with SET DATEFIRST statments and then can achieve the result.
it would immensely help...
October 27, 2011 at 1:40 am
Performace Guard (Shehap) (10/9/2011)
October 9, 2011 at 11:34 pm
Like this..
SELECT A.* , CrsAppOutput.Percentage , CrsAppOutput.EffectiveDate
FROM tblA A
CROSS APPLY
(
SELECT TOP 1 B.Percentage , B.EffectiveDate
FROM tblB...
October 6, 2011 at 12:28 am
How about this?
SELECT A.* , CrsAppOutput.Percentage
FROM tblA A
CROSS APPLY
(
SELECT TOP 1 B.Percentage
FROM tblB B
...
October 5, 2011 at 11:46 pm
Not information to check what wrong and what you require. You may want to read Jeff Moden's article on how to post your problems to get fast and accurate answers...
October 4, 2011 at 3:43 pm
How about this Jeff ???
; WITH cte AS
(
SELECT *
,RowNum = ROW_NUMBER() OVER( PARTITION BY eid ORDER BY eno )
,GrpCnt = COUNT(*) OVER(...
October 1, 2011 at 9:07 pm
October 1, 2011 at 8:55 pm
Try this:
SELECT
[IdPartition],
LEFT([SavesetID],8)AS Date,
SUBSTRING([SavesetID],38,4)AS DVSFilePath,
SUBSTRING([SavesetID],38,99)AS DVSFileName,
FolderStructure =
((CASE [IdPartition]
WHEN 0 THEN 'mailstore1 ptn1\'
WHEN 1 THEN 'mailstore1 ptn2\'
WHEN 2 THEN 'mailstore1 ptn3\'
END
)
+LEFT([SavesetID],4) + '\'
+SUBSTRING([SavesetID],5,2) +'-'
+RIGHT([SavesetID],2) +'\'
+SUBSTRING([SavesetID],38,1) +'\'
+SUBSTRING([SavesetID],39,3)...
September 30, 2011 at 2:22 pm
You cant use IF statement in a SELECT clause.. You can use CASE expression though.
September 30, 2011 at 2:17 pm
Try this:
1. This will be fruitful and can see the results in TEXT mode.
SELECT p1.Field,
STUFF ( ( SELECT ','+ Contents+ CHAR(13)
...
September 30, 2011 at 10:15 am
Mr.Rams, you are not kidding us right ? 😛
To be honest, I understood really nothing from your question.. Can you be more clear, more visualizing on asking ur question ??...
September 29, 2011 at 10:29 pm
This may be?
; with cte as
(
select *
, rn = ROW_NUMBER() over( partition by account order...
September 29, 2011 at 4:18 pm
shatrughna (9/29/2011)
You can try this one.
DECLARE @test-2 TABLE
(A INT,B INT,C INT)
INSERT INTO @test-2
SELECT 10,1,1
UNION ALL
SELECT 10,1,2
UNION ALL
SELECT 10,2,1
UNION ALL
SELECT 10,2,2
UNION ALL
SELECT 10,3,1
UNION ALL
SELECT 10,3,2
UNION ALL
SELECT 11,1,1
UNION ALL
SELECT 11,1,2
UNION ALL
SELECT...
September 29, 2011 at 9:36 am
There is a function called STUFF which will do exactly what you asked for.
September 29, 2011 at 2:01 am
maruthipuligandla (9/28/2011)
WHERE Serial not in (select Serial from ReDB.dbo.Countries)
The problem might be due to improper aliases.
Try this:
INSERT INTO ReDB.dbo.Countries (CountryID, Serial, CountryDesc, DateAdded)
SELECT NEWID(), Serial, CountryName, GETDATE()
FROM v8.dbo.Country v8_contry
WHERE...
September 28, 2011 at 3:19 pm
Viewing 15 posts - 601 through 615 (of 1,923 total)