LearnItFirst User Forum

SQL Server 2008 SSAS Training Videos
Welcome Guest Search | New Posts | Members | Log In | Register

MSSQL database Options
mitgeld
Posted: Friday, May 28, 2010 5:29:55 AM
Rank: Newbie

Joined: 5/28/2010
Posts: 1
Points: 3
Where do you live?: Amsterdam
Hello Everybody,

I'm working on a project for a work agency in the Netherlands.I made a java application for the workers to see what time they work at which company and which car they have to take to get there.

I want to retrieve this information from a MSSQL database into my java app into jtabels. The only problem i have is the MSSQL query to accomplish this.

These are the tables in my mssql database on a ms sql server:

tbl.EmployeeEmployee_ID PK
Employee_Name
Employee_House

tbl.EmployeeAssignment
Employee_ID
Assignment_ID

tbl.Assignment
Assignment_ID PK
Company_ID
Starttime
PickupTime

tbl.Company
Company_ID PK
Company_Name
Company_Info

tbl.Assignment
Car
Car_ID
Assignment ID

tbl.Car
Car_ID PK
Car_Number
Car_Location
Car_People

My goal for now is to select ALL from tbl.car where Employee_ID is "myID" and Assigment_ID is one of the maximum 2 IDs there are for a certain Employee.

Every Employee can work at more companies and every company has more employees. For every company there can be more cars assigned to it.

I have to finish this project soon and i really don't know how to fix this.I hope you guys can help me...

thanks

ps. if you want more details let me know....

Scott Whigham
Posted: Wednesday, June 02, 2010 7:39:40 AM


Rank: Super Mod

Joined: 3/20/2006
Posts: 476
Points: 1,053
Where do you live?: Dallas, TX
Show me the queries that you've written and it will be a little easier to help.
Users browsing this topic
Guest


Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.