Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Show Last 5 Closed Tickets

Posted on 2012-12-21
2
Medium Priority
?
338 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
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

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Question has a verified solution.

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

When trying to connect from SSMS v17.x to a SQL Server Integration Services 2016 instance or previous version, you get the error “Connecting to the Integration Services service on the computer failed with the following error: 'The specified service …
This month, Experts Exchange sat down with resident SQL expert, Jim Horn, for an in-depth look into the makings of a successful career in SQL.
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.

963 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