Help Needed.

  • Hi i was wondering if anyone here could help with this, it's proberbly quite simple but i just can't seem to be able to figure it out.

    I have a table with three coloums,

    Example

    customerID | eventtext | eventtimestamp

    123456 | unob | 2006-10-21 21:21.00

    123456 | NoAnswer | 2006-10-30 18:00.12

    123456 | unob | 2006-11-01 07:35.50

    All i need is the latest eventtext and the cutomerID.

    Any Ideas?

  • Hi,

    select distinct customerID , eventtext from tblCustomer C

    where eventtimestamp = (select Max(eventtimestamp) From tblCustomer where customerID = C. customerID )

     

    Hope this will slove your problem

    cheers

  • Thanks for the help.

    I thought that it might be that easy i just couldn't see it.

  • How about

    select top 1 eventtext, cutomerID

    from CustomerDB

    order by eventtimestamp desc

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply