Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Show Last 5 Closed Tickets

Posted on 2012-12-21
2
Medium Priority
?
336 Views
Last Modified: 2012-12-21
Hello Experts,

I have the following table with the values listed below. I need to display the Last 5 Closed Tickets based on the value "tkt_cmpl_dt" which has a DateTime that the ticket was closed.

Tickets Table:
  tkt_id  int  PK
  tkt_cmpl_dt  DateTime
0
Comment
Question by:asp_net2
[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 Comments
 
LVL 23

Accepted Solution

by:
Steve Wales earned 2000 total points
ID: 38713175
This will get the answer:

select top 5 tkt_id, tkt_cmpl_dt from tickets order by tkt_cmpl_dt desc

Open in new window

0
 
LVL 4

Expert Comment

by:brendonfeeley
ID: 38713179
Maybe something along the lines of:
SELECT TOP 5 * FROM tickets_table ORDER BY tkt_cmpl_dt DESC;
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
Ready to get certified? Check out some courses that help you prepare for third-party exams.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

670 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