Viewing 15 posts - 31 through 45 (of 82 total)
try this
SET @sql = @sql + 'AND CTDate <= CAST('''+@todate+''' AS DATETIME))'
October 17, 2006 at 12:45 pm
October 17, 2006 at 12:20 pm
Did you try like below
SELECT LEFT((RTRIM(ENAME)),CHARINDEX(',',(RTRIM(ENAME)))-1) LastName,
PARSENAME(REPLACE(STUFF((RTRIM(ENAME)),1,CHARINDEX(',',(RTRIM(ENAME)))+1,''),' ','.'),2) FirstName,
PARSENAME(REPLACE(STUFF((RTRIM(ENAME)),1,CHARINDEX(',',(RTRIM(ENAME)))+1,''),' ','.'),1) MiddleName
FROM TFILP
Ram
October 9, 2006 at 5:06 pm
Try this out (If you have more columns)
SELECT A.*
FROM tblXYZ AS A
INNER JOIN (
SELECT ColumnA,MIN(ColumnB) AS ColumnB
FROM tblXYZ
GROUP BY ColumnA
  AS B
ON A.ColumnA = B.ColumnA
AND A.ColumnB =...
October 9, 2006 at 5:01 pm
SEELCT ColumnA,MIN(ColumnB) OR MAX(ColumnB)
FROM tblXYZ
GROUP BY ColumnA
Ram
October 9, 2006 at 12:29 pm
CREATE TABLE xyz
(TABLE_NUM INT PRIMARY KEY,
VOICE INT IDENTITY(1,1))
-Ram
October 4, 2006 at 4:18 am
USE [DBName]
GO
SELECT 'GRANT ALL ON ['+Name+'] TO [User]' -- Change UserName here
FROM SysObjects
WHERE XType = 'P'
get the o/p query and run in QA.
Ram
October 4, 2006 at 1:23 am
Here you go
BEGIN
SET NOCOUNT ON
DECLARE @tblTarget TABLE
(Book VARCHAR(256),
Price INT,
DateUpdated DATETIME)
DECLARE @tblSource TABLE
(Book VARCHAR(256),
Price INT)
INSERT INTO @tblTarget VALUES('A',10,NULL)
INSERT INTO @tblTarget VALUES('B',5,NULL)
INSERT INTO @tblSource VALUES('A',10)
INSERT INTO @tblSource VALUES('B',15)
INSERT INTO @tblSource VALUES('C',8)
INSERT INTO @tblTarget (Book,Price,DateUpdated)
SELECT DISTINCT Book,Price,GETDATE()
FROM @tblSource AS Source
WHERE NOT EXISTS
(
SELECT 1
FROM @tblTarget AS Target
WHERE LTRIM(RTRIM(Source.Book)) = LTRIM(RTRIM(Target.Book))
-- AND ISNULL(Source.Price,-999) = ISNULL(Target.Price,-999)
 
October 4, 2006 at 1:15 am
Try this out
SELECT [Dept],
[Job Code],
SUM(CASE WHEN [Charge Code] IN ('NPO','REG E','HOL','VAC') THEN [Hrs Worked] ELSE 0 END) AS RegHours,
SUM(CASE WHEN [Charge Code] IN ('NPO','REG E','HOL','VAC') THEN [Dollars] ELSE 0 END) AS...
October 3, 2006 at 8:46 am
try this out
SELECT CONVERT(CHAR(30),GETDATE(),109) AS TimeStamp
October 3, 2006 at 8:37 am
Try UNION ALL instead UNION.....
October 2, 2006 at 2:23 pm
Try this out (You can modify this T-SQL according to your need)
DECLARE @tbl TABLE
(RowId VARCHAR(20),
RValue VARCHAR(30),
Lineage VARCHAR(3000) DEFAULT '')
INSERT INTO @tbl(RowId,RValue)
SELECT 1,'1A' UNION SELECT 1,'1B' UNION SELECT 1,'1C' UNION SELECT 1,'1D' UNION SELECT 2,'2A' UNION SELECT 2,'2B'...
October 2, 2006 at 7:41 am
or this
SELECT Owner,
MIN(PropertyId) AS MinId,
MAX(PropertyId) AS MaxId
FROM #Table
GROUP BY Owner
September 29, 2006 at 6:28 pm
Viewing 15 posts - 31 through 45 (of 82 total)