Show Last 5 Closed Tickets

asp_net2
asp_net2 used Ask the Experts™
on
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
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Senior Database Administrator
Commented:
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

Maybe something along the lines of:
SELECT TOP 5 * FROM tickets_table ORDER BY tkt_cmpl_dt DESC;

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial