+ Reply to Thread
Results 1 to 5 of 5

Get the total employee per position by entering the start and end date

  1. #1
    joe41
    Guest

    Get the total employee per position by entering the start and end date

    Hi,

    Actually i want to make a report that shows the total count of employee per position by entering the start date and end date per assign project.

    I m using this table:

    Project Table-
    ProjectNo
    Project NAme
    Nature of business
    Services
    Principal of the project
    principal address
    Position of Employee
    Place of Work
    FromDate
    ToDate
    EmpID

    I want to make a month report that show the total count of employee per position by principal. getting the info of month in the From and To Date. Can
    you help me with this...

    Thanks

  2. #2
    J.wills
    Guest

    Re: Get the total employee per position by entering the start and end date

    This will give you an idea. This is for the month of
    January 2009

    SELECT [Position of Employee], Count([Position of Employee]) as
    CountPosition
    FROM Project
    WHERE FromDate <= #2009-01-31# and ToDate >= #2009-01-01#
    GROUP BY [Position of Employee]

    if you want multiple months, the query is more complex and will need an
    additional table.

  3. #3
    joe41
    Guest

    Re: Get the total employee per position by entering the start and end date

    where should i put that code you give?,,..
    and what additional table should i add in my database to get that multiple
    months.

  4. #4
    J.wills
    Guest

    Re: Get the total employee per position by entering the start and end date

    What I posted was a query. You would paste that into the SQL view of a
    query. Adjust the Table and Field names to match your table and field names.

    The additional table would be a table of Dates covering the range of
    dates you have in your project table. Then you would have to use a more
    complex query joining your projects table to the Dates table.

    SELECT Format(Dates.TheDate,"yyyy-mm") as TheMonth
    ,[Position of Employee]
    , Count([Position of Employee]) as CountPosition
    FROM Project INNER JOIN Dates
    ON Dates.TheDate >= Project.FromDate
    AND Dates.TheDate <= Project.ToDate
    GROUP BY Format(Dates.TheDate,"yyyy-mm")
    ,[Position of Employee]

    You can filter that by adding a where clause against Dates.TheDate. For
    instance the following would get the information for the months of 2008.

    SELECT Format(Dates.TheDate,"yyyy-mm") as TheMonth
    ,[Position of Employee]
    , Count([Position of Employee]) as CountPosition
    FROM Project INNER JOIN Dates
    ON Dates.TheDate >= Project.FromDate
    AND Dates.TheDate <= Project.ToDate
    WHERE Dates.TheDate Between #2008-01-01# and #2008-12-31#
    GROUP BY Format(Dates.TheDate,"yyyy-mm")

    just do that....

  5. #5
    joe41
    Guest

    Re: Get the total employee per position by entering the start and end date

    Thanks very much Wills but i will be very much complex......is their any other way by which we can make it easy....

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1