CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2006
    Posts
    197

    Get date of last appearance of value on table

    I didnt know how to title this thread...
    I have a table with name,a number and a date.
    I need to get the date in wich, that number changed from zero from end to start.

    For example:
    I have
    name 1, 8, date1
    name 1, 0, date2
    name 1, 3, date3
    name 1, 8, date4
    name 1, 0, date5
    name 1, 0, date6

    from the last date to start the last day with "0" is date5, so I need to get that value or date4 and then I add 1 day.

    Any idea of how can I do this?
    Thanks

  2. #2
    Join Date
    Jan 2006
    Posts
    197

    Re: Get date of last appearance of value on table

    Don't answer this, im an idiot. After a long day making complex querys I couldnt resolve a simple:
    Select name,max(date)
    from table
    where number<>0
    group by name;

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured