Re: Access Format Equivalent

anonymous_at_discussions.microsoft.com
Date: 06/14/04

  • Next message: Maria: "Re: Finding tables referenced in a Stored Procedure"
    Date: Sun, 13 Jun 2004 23:11:22 -0700
    
    

    Thanks for the reply, but I think I found a simpler way.

    select right('000000' + convert(varchar,
    employee_number), 6)

    >-----Original Message-----
    >CREATE TABLE #Temp
    >(
    > Employee CHAR(6)
    >)
    >
    >INSERT INTO #Temp VALUES ('1')
    >INSERT INTO #Temp VALUES ('12')
    >INSERT INTO #Temp VALUES ('123')
    >INSERT INTO #Temp VALUES ('1234')
    >INSERT INTO #Temp VALUES ('12345')
    >
    >SELECT * FROM #Temp
    >
    >SELECT REVERSE(LEFT(LTRIM(REVERSE('000000'+
    Employee)),6))
    >FROM #Temp
    >
    >---
    >Rohtash Kapoor
    >http://www.sqlmantra.com
    >
    >"Bryan" <anonymous@discussions.microsoft.com> wrote in
    message
    >news:1c02d01c45186$9f7810d0$a001280a@phx.gbl...
    >> Hello:
    >>
    >> What would the equivalent syntax be to format the
    >> following in SQL as can be done in Access.
    >>
    >> Format("000000",employee) to return 012345 from 12345
    >>
    >
    >
    >.
    >


  • Next message: Maria: "Re: Finding tables referenced in a Stored Procedure"

    Relevant Pages

    • Re: Way OT Query...
      ... to reign in the use of temp services. ... workforce *instead of* a group of full time workers. ... employee (and also risk the extra expenses of having to terminate someone ... if the choice was permanent position or defer the work uhntil a later time, ...
      (rec.arts.sf.tv.babylon5.moderated)
    • Re: Way OT Query...
      ... to reign in the use of temp services. ... workforce *instead of* a group of full time workers. ... It's a calculated decision by a company; risk having to train a new employee ... 1) Get first temp job as bridge between ...
      (rec.arts.sf.tv.babylon5.moderated)
    • Re: Temp Tables
      ... > I believe that I need to create a temp table to hold data at runtime. ... > a user of my Leave Tracking db can either be a supervisor or an employee. ... > What's the best way to handle the reporting requests? ...
      (microsoft.public.access.modulesdaovba)
    • Temp Table
      ... I believe that I need to create a temp table to hold data at runtime. ... for an employee to look at their sick and annual leave ... whether they are a supervisor or just an employee. ... hold the user’s ID and any employee IDs that this employee may ...
      (microsoft.public.access.reports)
    • Re: Use entire table as a record in Access?
      ... Well, actually, it can't be a temp table referring to the original Employee ... Set the critera of the append query to soemthing that will limit the ... that's bound to tblEmpHours. ...
      (microsoft.public.access.macros)