Viewing 12 posts - 886 through 897 (of 897 total)
Try this. This works for the data provided. You can do additional changes for any other data.
create table #x
(phno int,
Description varchar(20),
qty int,
amt money)
insert into #x values(123,'abc',1,60)
insert into #x values(123,'abc',-1,60)
insert into...
December 7, 2009 at 11:18 am
Even this should work, say the name of table is Employees and the name of the column is DateOfJoin.
SELECT*
FROM Employees
WHEREDATEPART( DAY, DATEADD( DAY,...
December 7, 2009 at 9:58 am
Well. I never thought it can be done this way. Thanks for the additional info Ramesh.
April 6, 2009 at 12:32 pm
Sorry Try this one ..
Try this. I hope this works..
;WITH cteTable AS
(
SELECT ROW_NUMBER() OVER ( PARTITION BY zipcode ORDER BY datevalue ) AS RowNumber, *
FROM ...
March 7, 2009 at 10:52 am
Sorry Try this one ..
;WITH cteTable AS
(
SELECT ROW_NUMBER() OVER ( PARTITION BY officecode ORDER BY datevalue ) AS RowNumber, *
FROM ...
March 7, 2009 at 9:37 am
Try this..
;WITH cteTable AS
(
SELECT ROW_NUMBER() OVER ( PARTITION BY officecode ORDER BY datevalue ) AS RowNumber, *
FROM#Table
)
UPDATET
SET ...
March 7, 2009 at 9:32 am
Sorry for the error. I actually missed see the forum name. I think we can use the table variables or temporary tables with an identity column to solve this problem.
February 14, 2009 at 9:59 am
;WITH cteCountSpeed AS
(
SELECTROW_NUMBER() OVER ( ORDER BY Col1 ) AS Row, *
FROMtblCountSpeed
)
SELECTC1.Col1, C1.col2, ( C2.Col2 - C1.Col2 ) / ( C2.Col1 - C1.Col1 ) AS QueryColumn
FROMcteCountSpeed C1
LEFT OUTER JOIN cteCountSpeed...
February 13, 2009 at 11:50 am
INSERT INTO #PresentInfamily
SELECT * FROM #FamilyMembers
DECLARE@strSQLVARCHAR(MAX)
SELECT@strSQL = COALESCE( @strSQL, '' )
+ ' INSERT INTO #PresentInfamily( IndividualNo, MemberInFamilyID, PresentStartDate, PresentEndDate ) '
+ ' SELECT IndividualNo, MemberInFamilyID, ''' + CAST( DATEADD( DAY,...
February 13, 2009 at 11:15 am
Actually your code has put me in confusion with the names.
But just try if this works or if you get some idea
SELECT b.divid,sum(a.Amount)
FROM DailyTrans a,accounts_Info b
WHERE a.acctID=b.acctID
and (b.DivCode = 'AAA')...
February 12, 2009 at 8:26 pm
Viewing 12 posts - 886 through 897 (of 897 total)