Solved

Show Last 5 Closed Tickets

Posted on 2012-12-21
2
335 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 22

Accepted Solution

by:
Steve Wales earned 500 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

I'm trying, I really am. But I've seen so many wrong approaches involving date(time) boundaries I despair about my inability to explain it. I've seen quite a few recently that define a non-leap year as 364 days, or 366 days and the list goes on. …
I have a large data set and a SSIS package. How can I load this file in multi threading?
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed

626 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