469,596 Members | 2,269 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,596 developers. It's quick & easy.

How to select a word substring in a coumn header from right to left

I have an application providing me with multiple headers which I have
mergerd into one big header (below), this header my not always be the
same but I need to be able to extract a periodstart and periodend from
it. The periodstart will always be the third substring from the end
(or 3rd from right) and the periodend will always be the first
substring from the end (or 1st from the right).

How can I extract the periodstart and periodend?

E.g:- Header
'Jensen Alpha TR UKN GBP BM: Caut Mgd BM (50% FTAllSh 50% ML Broad
Mkt) RF DEF:RFI 3Y 31/08/2004 To 31/08/2007'
I currently have the sql: convert(Datetime,
(dbo.FDHGetWord(@FullHeader, 20)) ,103) but this only works in this
instance, I need to use someting like the RIGHT function or REVERSE
function but I can't get the sql right.

Can someone please help!????

Oct 8 '07 #1
1 1940
>I have an application providing me with multiple headers which I have merged into one big header (below), this header my not always be the same but I need to be able to extract a periodstart and periodend from it. The periodstart will always be the third substring from the end (or 3rd from right) and the periodend will always be the first substring from the end (or 1st from the right).<<

Did you mean "concatenate" and not "merge"? if you wanted these dates
why aren't they parameters to a procedure?

Since headers are a display concept, they have no place in a database
at all! Why not keep throw in the paper size colors to used for the
reports along with the headers??

And the final error is violating ISO-8601 date formats.
>>..but I can't get the SQL right. <<
That certainly is your problem. You have screwed up your design and
your whole approach to RDBMS. Get help from someone who has some idea
of what they are doing.

Oct 10 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Microsoft | last post: by
2 posts views Thread by N9 | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.