Viewing 15 posts - 61 through 75 (of 270 total)
Nice, Thanks!:-)
December 5, 2010 at 10:12 am
Couldn't you just pass the VARCHAR(MAX) value, the @where variable and the call of fnDelimitedSplit to the dynamic string?
The real code is more complex, thanks Lutz!:-)
November 23, 2010 at 5:27 pm
Thanks all for a response...:-)
I will try to be clear on my intended purpose...
I am pulling data up from a VARCHAR(MAX) field that is stored like this
data|data|data|etc
I turn this string...
November 23, 2010 at 3:16 pm
Ha ha...Done !
Thanks...for the help !:-):-D:-)
November 21, 2010 at 3:22 pm
Thanks, I added one more complication, another grouping field called 'Type', I get code errors..
Any ideas..
IF OBJECT_ID('tempdb..#test') IS NOT NULL DROP TABLE #test;
CREATE TABLE #test
(
[Date] DATETIME,
[Type] VARCHAR(10),
Symbol VARCHAR(10),
UpDown INT,
)
INSERT INTO...
November 21, 2010 at 2:54 pm
nice...thanks
here is my final code for others
DECLARE @Symbol VARCHAR(10)
DECLARE @Period INT
DECLARE @Period_sum DECIMAL(12,6)
DECLARE @anchor INT
DECLARE @moving_sum DECIMAL(12,6)
DECLARE @initial_sum DECIMAL(12,6)
SET @Symbol ='AAPL'
SET @Period = 20
IF OBJECT_ID('tempdb..#t1 ') IS NOT NULL...
November 19, 2010 at 2:40 pm
Here is the data a full code
GO
CREATE TABLE [DIM_Data_OHLC](
[RecID] [int] IDENTITY(1,1) NOT NULL,
[Symbol] [varchar](10) NOT NULL,
[Date] [datetime] NOT NULL,
[Close] [float] NULL
CONSTRAINT [PK_DIM_Data_OHLC] PRIMARY KEY NONCLUSTERED
(
[Symbol] ASC,
[Date] ASC
)WITH (PAD_INDEX...
November 19, 2010 at 2:23 pm
Fair enough how do I post 6000 records on this forum for testing
UPDATE: Do go away I will post the data...I am working it out !
November 19, 2010 at 2:08 pm
On a large dataset..
if you change
ON a.n - 20 = b.n
to this
ON a.n - @Intervals =b.n
The calc is a lot slower, from 1 sec to 12 sec...
November 19, 2010 at 2:07 pm
I am try to allow the SMA variable to be set by the variable @Intervals
This code works for a small data set, but one with 10,000 records, its slow
--Create our...
November 19, 2010 at 1:53 pm
This is the code posted by 'Gabriel P' on Posted 3/8/2010 5:23 PM
declare @intervals int, @initial_sum decimal(8,2)
declare @anchor int, @moving_sum decimal(8,2)
SET @INTERVALS = 20
with t1 as (select...
November 18, 2010 at 4:04 pm
Well, I tried with the SMA code from article and all I get is ERRORS...
Does any one have the final script that works ??
Here is code I copied..
--Create our...
November 15, 2010 at 5:32 pm
I have under a 1000 blos posts, so there is not a lot of data to worry about...
but here you go...
USE [DB785342]
GO
/****** Object: UserDefinedFunction [dbo].[fnBlogPosts] Script...
November 15, 2010 at 4:48 pm
Thanks, I ended up creating a function that return a table...all seams good !:-)
November 15, 2010 at 3:32 pm
Viewing 15 posts - 61 through 75 (of 270 total)