Viewing 15 posts - 361 through 375 (of 1,923 total)
Geoff you have been here quite long enuf to know how to post the questions ! Please follow the etiquettes mentioned in this article and provide us data in consumable...
March 22, 2012 at 9:16 am
Lynn Pettis (3/21/2012)
We only think we know the position. Just because the sample data has the hyphens in the same position in each record. This is something that...
March 21, 2012 at 7:52 pm
Lynn Pettis (3/21/2012)
Here is another way to do it:Here is the dbo.DelimitedSplit8K function:
Lynn, as we know the exact positions of the hyphen, i dont really think we would need Delimited...
March 21, 2012 at 5:51 pm
Explicitly, before loading the data into the the destination column, u can use CAST/CONVERT to convert them.
But, AFAIK, SQL Server will implicitly convert the source columns to NVARCHAR(20) before inserting..
March 21, 2012 at 5:02 pm
Very similar to yours!
SELECT LEFT ( CrsApp.CtStr , CHARINDEX('-',CrsApp.CtStr) -1 )
FROM #Test T1
CROSS APPLY (SELECT STUFF ( T1.TestColumn , 1 , CHARINDEX('-',T1.TestColumn),'') ) CrsApp (CtStr)
March 21, 2012 at 4:37 pm
Similar to yours, but with one CHARINDEX and all LEN removed
CRAP CODE 😀
March 21, 2012 at 4:33 pm
Another question to you, the start and end of the report times (the 2 vairables u have declared), what will the range be? is it a day or a week...
March 21, 2012 at 10:13 am
jones.justinw (3/21/2012)
Thanks!! I'd love to see what you can come up with
Im still working on.. in the meantime, im in the process of learning C#.. it would be great if...
March 21, 2012 at 10:09 am
CELKO (3/20/2012)
March 20, 2012 at 5:38 pm
LOVE the way you put down the requirement... As Barney Stinson(from How I Met Your Mother serial) says, Legennnnn.... wait for it... daryy..
Sure others might have also started working...
March 20, 2012 at 5:27 pm
How about this?
; WITH Tens (N) AS
(
SELECT 1 UNION ALL SELECT 1 UNION ALL SELECT 1 UNION ALL SELECT 1 UNION ALL
SELECT 1 UNION ALL SELECT 1 UNION ALL...
March 20, 2012 at 4:42 pm
i cant see the contents of ##mytable2 as you are joining table1 and table2 which i dont have.. i need to see your data (mock-up data, of course) to work...
March 20, 2012 at 3:25 pm
now out of the result set, how do u want to order it?
can u show your desired output?
March 20, 2012 at 1:59 pm
Viewing 15 posts - 361 through 375 (of 1,923 total)