Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2006

    Unanswered: Second Last Record?

    Hi All

    I have a Query in which i get to the last record using a "flag" for eg an order reference has "n" number of orders and i check the details for the last order using a flag say ord_last="-1"

    Now if the last order is a "certain type" another field, i want to check the second last record instead of the last.

    Can i do it in a single query! i could not find any "If" constructs in MS access to do the same! can i avoid using multiple queries?

  2. #2
    Join Date
    Oct 2006
    what about a descending sort? Just say SELECT TOP 2 ... ORDER BY ... DESC

    Then you'll have the last one and the 2nd to last one.

    I think Access supports the TOP phrase.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts