SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Thread: Loop - SP Help?

  1. #1
    SitePoint Evangelist
    Join Date
    Jun 2004
    Location
    ny
    Posts
    560
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Loop - SP Help?

    Hi all,
    I am trying to succeed:
    1)Loop through this samle output (that could be lots of records)
    2)If same personnelnumber and current row's oldValue is 1 and previous row's value is 0
    3)Take current and previous operationDate and select some records from another tbl between those operationDates. Each iteration will append the result of select statement and populate the final output.

    Code:
    PersonnelNumber	OldValue	operationDate
    89722	1	2012-04-19 21:00:24.150
    89722	0	2012-04-17 15:09:33.720
    89722	1	2012-04-17 14:46:06.410
    89722	0	2012-04-17 12:03:54.313
    89783	1	2012-05-06 21:00:33.917
    89783	0	2012-05-04 12:14:32.077
    89778	1	2012-05-06 21:00:33.913
    89778	0	2012-05-04 12:14:32.087

  2. #2
    From Italy with love silver trophybronze trophy
    guido2004's Avatar
    Join Date
    Sep 2004
    Posts
    9,509
    Mentioned
    163 Post(s)
    Tagged
    4 Thread(s)
    Sounds more like a coding question to me, so I've moved the thread (to the PHP forum assuming that's what you're using).
    Could you post the code you've got so far?


Bookmarks

Posting Permissions

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