Viewing 15 posts - 61 through 75 (of 1,922 total)
SQLKnowItAll (7/17/2012)
SQLKnowItAll (7/17/2012)
guerillaunit (7/17/2012)
WHERE CASE WHEN @test-2 <> '' THEN Agent = @test-2 ELSE --no where...
July 17, 2012 at 1:01 pm
If you still insist on having a WHERE clause, here is the WHERE Clause:
WHERE CASE WHEN @test-2 <> '' THEN Agent ELSE 1 END = CASE WHEN...
July 17, 2012 at 12:58 pm
Better handled via a IF clause than in WHERE clause.
July 17, 2012 at 12:56 pm
THis?
select lastname + ' , ' + firstname
from <YourTable>
July 17, 2012 at 9:52 am
Like this?
DECLARE @MinDate DATETIME
,@MaxDate DATETIME
,@Diff INT
;
SELECT @MinDate = MIN (pms.ParameterTimestamp)
...
July 16, 2012 at 11:41 pm
This?
; WITH CTE (RowID, RegisteredSpendDate, FinancialYr, SpendPerFinYr,FinQtr) AS
(
SELECT 1, '01/01/12', 2012, 100, 'Q1'
UNION ALL SELECT 2, '01/04/12', 2012, 100, 'Q2'
UNION ALL SELECT 3, '01/04/12', 2012, 100, 'Q2'
UNION ALL...
July 16, 2012 at 2:57 pm
Fantastic job in posting the table, sample data and required results. Makes life easier 🙂
Here is what you are looking after:
; WITH cte AS
(
SELECT *
,RN =...
July 13, 2012 at 4:01 pm
Are u using the same idea that im used on your example? Just multiply denominator with 1.00 (this triggers implicit conversion) and there by u ll get decimal places..
July 12, 2012 at 3:21 pm
Try this:
Select e.Dept, e.Numerator, e.Denominator
,(CASE WHEN e.Denominator=0 THEN 0
...
July 12, 2012 at 1:13 pm
I am kinda confused. Can you please let me know the expected reuslt form the sample data you posted in the first post?
Also, 472884 does not have 3 BLL transactions;...
July 10, 2012 at 3:35 pm
something like this?
DECLARE @Primary TABLE
( iD INT IDENTITY(1,1)
,Charac CHAR(1)
)
DECLARE @Secondary TABLE
( iD INT IDENTITY(1,1)
...
July 10, 2012 at 3:29 pm
And what if there are more than 2 rows for TrasactionTypeCode = "BLL" ?? How would that change ur expected result?
July 10, 2012 at 3:19 pm
Can you also show us the expected results out of the sample data posted?
July 10, 2012 at 3:18 pm
How to identify/ascertain that the following belogns to Row 1
part 1
region 10
area 7
and the following belongs to Row 2
part 2
region 11
area 8
??
July 9, 2012 at 9:43 am
First, lets set-up the sample data. It would much much easier for the people who respond, to have the data already set-up for testing. Hope your future questions follow the...
July 8, 2012 at 11:44 pm
Viewing 15 posts - 61 through 75 (of 1,922 total)