Solved

stored proc

Posted on 2014-03-12
1
246 Views
Last Modified: 2014-03-12
I want a stored procedure that accepts 3 param (userid,fromdate,todate) from table "JobCard"

and it should display 3 columns from this table(Ticket#,Description,Duration).

I am new to storedprocedures so need help in executing/creating it.
0
Comment
Question by:Moizsaif123
1 Comment
 
LVL 52

Accepted Solution

by:
Carl Tawn earned 500 total points
Comment Utility
Maybe something like the following (assumptions made about a couple of columns since you haven't provided a schema for the table):
CREATE PROCEDURE spGetJobCardDetails
    @UserId INT,
    @FromDate DATETIME,
    @ToDate DATETIME
AS
BEGIN

      SELECT [Ticket#], [Description], [Duration]
           FROM JobCard
           WHERE [UserId] = @UserId
               AND [Date] BETWEEN @FromDate AND @ToDate

END

Open in new window

0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Long way back, we had to take help from third party tools in order to encrypt and decrypt data.  Gradually Microsoft understood the need for this feature and started to implement it by building functionality into SQL Server. Finally, with SQL 2008, …
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

762 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

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now