smart headers

  • you gotta try what i posted: you end up with a 15 character string with the preceeding zeros you requested.

    SELECT RIGHT('000000000000000' + CONVERT(VARCHAR,1),15)

    SELECT RIGHT('000000000000000' + CONVERT(VARCHAR,86456),15)

    SELECT RIGHT('000000000000000' + CONVERT(VARCHAR,765486456),15)

    SELECT RIGHT('000000000000000' + CONVERT(VARCHAR,SomeColumnName),15)

    SELECT RIGHT('000000000000000' + CONVERT(VARCHAR,@SomeVariable),15)

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • Ya gotta love those that don't even try the suggestions given... guess these "experts" can just look and see "bad code"

    I'm not sure I'd have been so gracious, Lowell

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Lowell (21/09/2007)


    you gotta try what i posted: you end up with a 15 character string with the preceeding zeros you requested.

    SELECT RIGHT('000000000000000' + CONVERT(VARCHAR,1),15)

    SELECT RIGHT('000000000000000' + CONVERT(VARCHAR,86456),15)

    SELECT RIGHT('000000000000000' + CONVERT(VARCHAR,765486456),15)

    SELECT RIGHT('000000000000000' + CONVERT(VARCHAR,SomeColumnName),15)

    SELECT RIGHT('000000000000000' + CONVERT(VARCHAR,@SomeVariable),15)

    <DIV id=_ctl1_ctlTopic_ctlPanelBar_ctlTopicsRepeater__ctl6_smAuthorName_SimpleMenuDivLayer style="DISPLAY: inline" onclick="InstantASP_OpenMenu('_ctl1_ctlTopic_ctlPanelBar_ctlTopicsRepeater__ctl6_smAuthorName','_ctl1_ctlTopic_ctlPanelBar_ctlTopicsRepeater__ctl6_smAuthorName_SimpleMenuDivLayer','

    View Member\'s Profile
    Add to Buddy List
    Send Private Message
    Send Email To Member
    Find All Member\'s Posts

    ','165px');" onmouseover="InstantASP_OpenMenuMouseOver('_ctl1_ctlTopic_ctlPanelBar_ctlTopicsRepeater__ctl6_smAuthorName','_ctl1_ctlTopic_ctlPanelBar_ctlTopicsRepeater__ctl6_smAuthorName_SimpleMenuDivLayer','

    View Member\'s Profile
    Add to Buddy List
    Send Private Message
    Send Email To Member
    Find All Member\'s Posts

    ','165px');">Lowell,

    thx again it is work.. i forget the convert parts.. 😉  that is why it didn't works.. iam really thankful ...

Viewing 3 posts - 16 through 17 (of 17 total)

You must be logged in to reply to this topic. Login to reply