CONVERT() problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • mezzanine1974

    CONVERT() problem

    In access query, i can use following expression to show "AnyInteger "
    in the format of "0000"

    CStr(Format(Any Integer,"0000") )

    eg:
    12 yields to 0012
    8 yields to 0008

    how should i use CONVERT() function in SQL SERVER to achive my goal
    please?

  • Madhivanan

    #2
    Re: CONVERT() problem

    On Jul 17, 6:54 pm, mezzanine1974 <savas_karadu.. .@yahoo.comwrot e:
    In access query, i can use following expression to show "AnyInteger "
    in the format of "0000"
    >
    CStr(Format(Any Integer,"0000") )
    >
    eg:
    12 yields to 0012
    8 yields to 0008
    >
    how should i use CONVERT() function in SQL SERVER to achive my goal
    please?

    Formation matters only if you want to show them in front end
    application. Otherwise use

    Select right('0000'+ca st(anyinteger as varchar(4)),4)

    Comment

    • mezzanine1974

      #3
      Re: CONVERT() problem

      hi Madhivanan,
      it is working excellent!
      Thanks

      Comment

      • Madhivanan

        #4
        Re: CONVERT() problem

        On Jul 17, 7:31 pm, mezzanine1974 <savas_karadu.. .@yahoo.comwrot e:
        hi Madhivanan,
        it is working excellent!
        Thanks

        You are welcome [:)]

        Comment

        • --CELKO--

          #5
          Re: CONVERT() problem

          In a tiered architecture, formatting and display are done in the front
          end and not the database.

          You will need about a year to UN-learn ACCESS (monolithic single user
          desktop design) and start writing SQL (tiered, multi-user, client
          server).


          Comment

          • mezzanine1974

            #6
            Re: CONVERT() problem

            You will need about a year to UN-learn ACCESS (monolithic single user
            desktop design)
            It sounds to me very dramatical (


            Comment

            • --CELKO--

              #7
              Re: CONVERT() problem

              >It sounds to me very dramatic <<

              No, that estimate of a year of un-learning is based on being involved
              with the ANSI/ISO Standards, teaching SQL and RDBMS for a few decades,
              and writing eight books on the topic.

              "Perfecting oneself is as much unlearning as it is learning." --
              Edsger Dijkstra

              Comment

              Working...