Forum Replies Created

Viewing 15 posts - 9,586 through 9,600 (of 10,144 total)

  • RE: Report # of characters for an integer value

    gpeters (9/10/2008)


    Awesome. Thank you Mr or Mrs. 500.

    You're very welcome 'Forum Newbie', thanks for the feedback.

  • RE: Traversing Rows

    karthikeyan (9/10/2008)


    Hi All,

    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 ...

  • RE: Report # of characters for an integer value

    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') ...

  • RE: Report # of characters for an integer value

    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

    )...

  • RE: Report # of characters for an integer value

    -500.55 isn't an integer value. Can you be more specific?

    Cheers

    ChrisM

  • RE: Report # of characters for an integer value

    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

  • RE: String function

    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...

  • RE: String function

    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...

  • RE: Date Conversion

    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,...

  • RE: String function

    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...

  • RE: Odd Construct in a WHERE clause

    Richard Fryar (9/10/2008)


    I've just tried this on SQL Server 2005 Standard

    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...

  • RE: Date Conversion

    chad_hainline (9/10/2008)


    I have at a table whihc for export purposes to an accounting software needs to have the invoice date in a dd/mm/yyyy format, which is not a problem....

  • RE: Beginning to hate dynamic sql and variables

    You're welcome Simon, thanks for the feedback. Have another coffee, it helps 🙂

  • RE: If you can read this...

    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,...

  • RE: Beginning to hate dynamic sql and variables

    Hi Simon

    @TableName is out of scope of the statement which is supposed to be using it. You need to change your line to

    ...

Viewing 15 posts - 9,586 through 9,600 (of 10,144 total)