Viewing 15 posts - 106 through 120 (of 148 total)
Also, you should think carefully about indexes required on the source table and the temporary interim table - pivot is costly without the correct indexes...
September 1, 2010 at 9:13 am
Ok, so maybe I'm not quite clear. It seems that you need to group ny Partners with Periods in columns, but also by Accounts with Periods in columns?
If so,...
September 1, 2010 at 9:11 am
Hi Bezan,
I'm not sure what you mean - the initial criteria limits the data returned to one combination of Partner & Account only.
To see all combinations, just tweak the...
September 1, 2010 at 8:08 am
Jeff Moden (9/1/2010)
Ooooooo... crud. I'm on my way to work and always miss out on the fun stuff. I'll be watching whoever gets to this one. 😛
Lol, I'm...
September 1, 2010 at 7:42 am
Hi,
This should get you the data you need, it's then just a case of using the previous advice on dynamic pivots to get the data into the display format you...
September 1, 2010 at 7:38 am
Hi Grasshopper,
You're going to struggle to work with the file in the format it's in. SQL needs your data to be organised into discrete entities with rows and columns. Your...
September 1, 2010 at 6:24 am
Hi,
I think a tally table solution is better here as it accepts any number of values in the input:
create function dbo.udf_Get_Max_From_String (
@string_input varchar(4000)
)
returns int
with schemabinding
as
begin
-- make a table to...
July 21, 2010 at 8:26 am
Do you get an error message, or id it just that it doesn't return the data you expect?
Maybe you could try
where charindex(MyFieldName,@variable) > 0
or you might want to check...
May 28, 2010 at 6:18 am
Hi,
You need to pass the results of your query to a variable, then call this using either exec or preferably sp_executesql.
I'm assuming that you'll have more than one stored...
May 10, 2010 at 8:57 am
Hi,
Try splitting the work using a CTE:
; with cte as (
SELECT T3.state AS [State],
SUM(T1.Applications) As Total,
SUM(T1.UnitsSold) as TotalSold,
SUM(T1.Revenue) as Revenue,
T1.VendorId
FROM TABLE1 T1 WITH(NOLOCK)
INNER JOIN TABLE2 T2 WITH(NOLOCK) ON...
May 10, 2010 at 8:42 am
Ha really? Lol, that won't work then will it? Complex function it is then.
April 30, 2010 at 2:39 am
Hi Lutz,
I'm migrating data between two quite different environments. It's my issue to handle because I've created the problem in the first place by converting from float.
Paul, cast to...
April 29, 2010 at 7:38 am
Hi Saeed,
You could try something like this (air code):
with cte as (
select MyTable.*,
case when MON = 1 then 1
when TUE = 1 then 2
when WED...
March 3, 2010 at 7:27 am
Hi Handkot,
That would have been my ideal choice too, if I didn't have to remove the value from the old field too. Because of that, I need to know which...
February 25, 2010 at 2:21 am
Viewing 15 posts - 106 through 120 (of 148 total)