Transact Max Statement

From: Scott D (sdavenport_at_sigcom.net)
Date: 06/16/04

  • Next message: Zidgan: "temp tables and locking issues"
    Date: 16 Jun 2004 12:13:31 -0700
    
    

    I am trying to execute a SELECT statement that will have one of the
    parameters only needing to be the last log entry.

    Example: (This should help)

    I want to do something like this

    SELECT tblTicket.Name, tblTicket.Address, (SELECT tblTicketLog.Entry
    WHERE Max(tblTicketLog.EntryID)) FROM tblTicket INNER JOIN
    tblTicketLog ON tblTicketLog.EntryID = tblTicket.EntryID

    I know this syntax is incorrect as it throws an error. Basically this
    is a help desk system that needs to show open tickets and their last
    log entry. The table structure is as follows:

    tblTicket
    ---------
    TicketNo PK

    tblTicketLog
    ------------
    TicketNo FK
    EntryID PK
    Entry

    I will be glad to explain further if this makes no sense. Thank you
    in advance for your help.


  • Next message: Zidgan: "temp tables and locking issues"
    Loading