Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to retrive start and end date 1

Status
Not open for further replies.

ttechie

Technical User
Feb 11, 2005
56
0
0
IN
Hi
I am new to SQL. I am trying to retrive data about employee name, Start date and Last date. How do I do this? I know it is very simple question but I am very new to this.
thanks

select start date, end date, last name ???
from employee
where ???



 
It will depened on what the columns are called and what the tables are named. You'll need to look at the table and find the columns you are looking for.

Denny
MCSA (2003) / MCDBA (SQL 2000)

--Anything is possible. All it takes is a little research. (Me)
[noevil]
 
You need to provide us the structure of your table(s) so that we can help you with the solution.

If you table is just:

EmpTable
LastName FirstName StartDate EndDate
Doe John 2005-11-01 2005-11-29
Smith Jane 2004-01-01 2005-11-15

You would do:

SELECT LastName, StartDate, EndDate
FROM EmpTable

But if that isn't what your data looks like, then that won't work.

-SQLBill

Posting advice: FAQ481-4875
 
I agree with mrDenny. You could run this query to provide that information.

Select * from Information_Schema.Columns Where Table_Name = 'Employee'

(Assuming the table name is actually Employee and not something else).

-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 
Thanks guys for the help.
what about the where part. How does that work?
 
Check the Books On Line for help. This will be your best friend while learning.

Jim
 
A select statement will return data for every row (think employee) in the table. You can use the where clause to filter the records returned from the query.

Ex.

Select * From Employee Where EyeColor = 'Brown'

Or

Select * From Employee Where ShoeSize > 8 and YearlySalary < 12000

If you don't have a where clause, all of the data will be returned.

-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top