Viewing 15 posts - 1 through 15 (of 16 total)
hi Friend,
Try This way..
DECLARE
@start_date DATETIME,
@end_date DATETIME,
@start_date1 DATETIME,
@end_date1 DATETIME
DECLARE...
February 24, 2012 at 5:52 am
TRY THIS
SELECT
E.NAME,
100 - SUM(ISNULL(ET.SOMEVALUE,0)) AS TESTCOLUMN
FROM
@EXAMPLETABLE ET RIGHT JOIN @EMPLOYEE E ON ET.EMPLOYEEID = E.ID
WHERE
ET.EMPLOYEEID=E.ID
GROUP BY E.NAME
December 7, 2011 at 1:47 am
TRY...
SELECT
E.NAME,
100 - SUM(ISNULL(ET.SOMEVALUE,0)) AS TESTCOLUMN
FROM
@EXAMPLETABLE ET RIGHT JOIN @EMPLOYEE E ON ET.EMPLOYEEID = E.ID
WHERE
ET.EMPLOYEEID IN ('1','2')
GROUP BY E.NAME
December 7, 2011 at 1:46 am
try This.
DECLARE @CIDHR VARCHAR(100)
DECLARE @HARAR TABLE(PID VARCHAR(10),CID VARCHAR(10),CTP VARCHAR(10))
SET @CIDHR=''
INSERT INTO @HARAR
SELECT 'TP1' as PID,'TC1' as CID,'C' as CTP UNION ALL
SELECT 'TP1' as PID,'TP2' as CID,'P' as...
December 7, 2011 at 1:25 am
Thanks Kingston Dhasian
Its work.....:hehe:
December 5, 2011 at 6:33 am
Dear Subba Try This....
declare @t1 TABLE(id int,region varchar(10),Lamt decimal(20,3))
insert into @t1 values(1,'x',10.12)
insert into @t1 values(1,'y',20.12)
insert into @t1 values(1,'z',30.12)
declare @t2 TABLE(id int,region varchar(10),lamt decimal(20,3))
insert into @t2 values(1,'x',55.12)
insert into @t2 values(1,'y',57.12)
insert into...
December 5, 2011 at 5:21 am
U can do it by Matric Report. and Convert Month Numeric value to month Name for showing column Header as Jan,feb, march
December 5, 2011 at 5:11 am
Check Query That I tried
DECLARE @CFR as Table
(CFRCode varchar(50),
CFR_MATCH Varchar(10),
CFR_COMM_CODE varchar(50),
CFR_COMM_DESC varchar(250),
Final_DEsc varchar(300))
DECLARE @CFR_SAVVION as Table
(CFRCode varchar(50),
CFR_COMM_CODE varchar(50),
COMMENT varchar(250))
INSERT INTO...
December 5, 2011 at 5:06 am
I don it by using Cursor..
DECLARE @HIPTMP TABLE
( [ID] [int] NULL,
[HIP1Person_Name] [varchar](50) ,
[HIP1RelationShip] [varchar](10),
[HIP1Amount] [int] NULL,
[HIP1Casetype] [varchar](40),
[HIP1Addess] [varchar](100))
DECLARE @Person_Name varchar(50)
DECLARE @RelationShip varchar(50)
DECLARE @Amount int
DECLARE @Casetype...
November 21, 2011 at 3:09 am
I tried it by Pivot Function But it work with only Aggregate Function.
My Requirement to Pivot Multiple Row with Multiple Column to Single Rows
---:-)
November 21, 2011 at 2:59 am
Try This Select Statement IN MYSQL
SELECT MAX(logindate) as Login_DATE
FROM UserLoginTable
WHERE user_id = @user_id
November 20, 2011 at 8:57 pm
If all DB on same server then u can create data source with respect to any of DB but make sure to Specify DB Name along with Query like DB...
November 18, 2011 at 11:46 am
Try This.
CREATE PROCEDURE [dbo].[usp_TestSP]
@tblClientIds dbo.tblTypeIds = null readonly
AS
BEGIN
SET NOCOUNT ON;
Declare @TEMPID int
Select @TEMPID=COUNT(*) from @tblClientIds
IF @TEMPID=0
BEGIN
SELECT * from Client
END
ELSE
BEGIN
SELECT * from Client where ClientId in (Select ID...
November 15, 2011 at 10:10 pm
Try This.
CREATE PROCEDURE [dbo].[usp_TestSP]
@tblClientIds dbo.tblTypeIds = null readonly
AS
BEGIN
SET NOCOUNT ON;
Declare @TEMPID varchar(10)
Select @TEMPID=ID from @tblClientIds
SELECT * from Client where ClientId in (CASE WHEN @TEMPID is NULL THEN...
November 15, 2011 at 8:56 pm
Viewing 15 posts - 1 through 15 (of 16 total)