Solved

Sql Query Report

Posted on 2009-04-01
4
178 Views
Last Modified: 2012-05-06
Hi Everybody,
i have a table in my sql with this structure:
ID - EMPLOYEE_NAME - REGISTER_DATE
1         Gustavo                    01/12/2008  08:03:00am
1         Gustavo                    01/12/2008  01:03:00pm
1         Gustavo                    01/12/2008  02:00:00pm
1         Gustavo                    01/12/2008  06:03:00pm

i use this table to register the assitance of my employees and i'm registering the info like that.
my problem i'm trying to make an assitance report but i don't found the way to do this report
i need a report like this or if somebody have a better solution is welcome
this is what i'm looking for:
ID - EMPLOYEE_NAME - REGISTER_DATE1 - REGISTER_DATE2 - REGISTER_DATE3
1         Gustavo            01/12/08 08:03:00am  01/12/08 01:03:00am  01/12/08 02:00:00am

thanks a lot guys

Gustavo
0
Comment
Question by:gesquivel
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 15

Expert Comment

by:MNelson831
ID: 24043611
What happens if Gustavo registers 137 times?  Your report won't fit on the page.  You are far better off to do it this way:

ID - EMPLOYEE_NAME - REGISTER_DATES
1         Gustavo            01/12/08 08:03:00am  
                                     01/12/08 01:03:00am  
                                     01/12/08 02:00:00am
0
 
LVL 1

Author Comment

by:gesquivel
ID: 24044930
i just only takes 4 register.
for example if:

ID - EMPLOYEE_NAME - REGISTER_DATES
1         Gustavo            01/12/08 08:03:00am  
                                     01/12/08 01:03:00am  
                                     01/12/08 02:00:00am
                                     01/12/08 03:00:00am
                                     01/12/08 04:00:00am
                                     01/12/08 05:00:00am
                                     01/12/08 06:00:00am

i only take the first 2 and the last 2for the report

thanks a lot
0
 
LVL 4

Expert Comment

by:y0usuf
ID: 24045674
I think you can try using pivot join in sql.
0
 
LVL 1

Accepted Solution

by:
gesquivel earned 0 total points
ID: 24331978
i solve it
i create a  row_number() for each result so then i call a function and that's all!
i solve it!

thanks a lot

Gustavo
0

Featured Post

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question