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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Stored Procedure or View to Print out One Record 1

Status
Not open for further replies.

GammelNok

Programmer
Jun 21, 2002
32
0
0
US
Hi
I am trying to produce a Stored Procedure to print a Timesheet based on multiple entries for any given Chap/Chapess in any given week

Here is my attempt so far

CREATE PROCEDURE qselTIMEDataOne (@timeTeamID int, @timeWeekEnding datetime)

SELECT timeTeamID int, timeWeekEnding datetime
FROM tblTIMEMainData
WHERE timeTeamID = @timeTeamID AND timeWeekEnding = @timeWeekEnding
GO

This obviousely does nor work, and I am open to suggestions

Cheers

Hans
 
Not entirely sure what you want but start by taking out the int and datetime from the SELECT list.

--James
 
You should check the SQL BOL for proper syntax.


In addition to James' suggestion, you need the keyword AS.

CREATE PROCEDURE qselTIMEDataOne
@timeTeamID int,
@timeWeekEnding datetime)
AS

SELECT timeTeamID, timeWeekEnding
FROM tblTIMEMainData
WHERE timeTeamID = @timeTeamID
AND timeWeekEnding = @timeWeekEnding
GO



If you want to get the best answer for your question read faq183-874 and faq183-3179.
Terry L. Broadbent - DBA
SQL Server Page:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top