Viewing 15 posts - 9,586 through 9,600 (of 10,144 total)
gpeters (9/10/2008)
Awesome. Thank you Mr or Mrs. 500.
You're very welcome 'Forum Newbie', thanks for the feedback.
September 10, 2008 at 8:27 am
karthikeyan (9/10/2008)
I have one senario.
ID Value
1MAGFX
150
1Comment1
2MALOX
250
2Comment2
3MAGFX
350
3Comment3
I want to display like
1 MAGFX 50 Comments1
2 ...
September 10, 2008 at 8:17 am
gpeters (9/10/2008)
I was hoping I could convert the float value to string in order use len in my select stmt:
i.e. select len ('-500.55') ...
September 10, 2008 at 8:12 am
Oh, ok...
[font="Courier New"]SELECT FloatValue, LEN(FloatValue) AS Length
FROM (
SELECT CAST(1 AS FLOAT) AS FloatValue UNION ALL
SELECT 22 UNION ALL
SELECT 333 UNION ALL
SELECT 4444 UNION ALL
SELECT -500.55
)...
September 10, 2008 at 7:56 am
-500.55 isn't an integer value. Can you be more specific?
Cheers
ChrisM
September 10, 2008 at 7:26 am
You mean, the length? Like this?
SELECT IntegerValue, LEN(IntegerValue) AS Length
FROM (
SELECT CAST(1 AS INT) AS IntegerValue UNION ALL
SELECT 22 UNION ALL
SELECT 333 UNION ALL
SELECT 4444 ) d
September 10, 2008 at 7:00 am
Hi Khushbu
You're welcome, thanks for the feedback.
The number of rows will probably matter if there are hundreds of thousands. If the query runs too slowly (and it runs in minutes...
September 10, 2008 at 6:00 am
Thanks Jeff, and thanks also for posting up your tally table article. One of these days I'll take the time to put them in my sig
INSERT INTO sig SELECT Tally...
September 10, 2008 at 5:50 am
If it's varchar then this would do the trick:
[font="Courier New"]DROP TABLE #Test
CREATE TABLE #Test (mmddyyyy VARCHAR(10))
INSERT INTO #Test
SELECT '01/01/2008' UNION ALL
SELECT '31/01/2008' UNION ALL
SELECT '01/02/2008' UNION ALL
SELECT '28/02/2008'
SELECT mmddyyyy,...
September 10, 2008 at 5:32 am
Yep, you need a tally table:
[font="Courier New"]DROP TABLE #Temp
-- make some sample data
CREATE TABLE #Temp (col1 CHAR(1), col2 VARCHAR(20), col3 VARCHAR(20))
INSERT INTO #Temp (col1, col2, col3)
SELECT 'a', '6-10,4,5', 'hjkj..............' UNION...
September 10, 2008 at 5:30 am
Richard Fryar (9/10/2008)
select 'x' where 1=0 and 1/0=0
select 'x' where 1/0=0 and 1=0
select 'x' where 1=1 and 1/0=0
select 'x' where 1/0=0...
September 10, 2008 at 5:13 am
chad_hainline (9/10/2008)
September 10, 2008 at 5:07 am
You're welcome Simon, thanks for the feedback. Have another coffee, it helps 🙂
September 10, 2008 at 4:43 am
Christian Buettner (9/9/2008)
..., then we are still alive!Save the date: 10 September 2008, 07:30 GMT
http://en.wikipedia.org/wiki/Large_Hadron_Collider
http://www.youtube.com/watch?v=s9XotvwgnaY
I just hope that they know what they are doing 😉
They know what they're doing Chris,...
September 10, 2008 at 4:27 am
Hi Simon
@TableName is out of scope of the statement which is supposed to be using it. You need to change your line to
...
September 10, 2008 at 4:23 am
Viewing 15 posts - 9,586 through 9,600 (of 10,144 total)