so here&#039;s what I&#039;m started:<BR><BR>/*stored proc will run at midnight:01 */<BR>SET @Today=GETDATE()<BR>SET @TodayBegin=dateadd("d",-1,@Today)<BR>select @today<BR>select @todaybegin<BR>SELECT * FROM transit_history WHERE <BR> datepart(month, action_time) = DATEPART(month, @TodayBegin)<BR> AND datepart(year, action_time) = DATEPART(year, @TodayBegin)<BR> AND DATEPART(day,action_time) = DATEPART(day, @TodayBegin)<BR><BR>i want to take everything i retrieve, and for each container_id in transit_history i want to make a new row in a different table. It&#039;d be like:<BR><BR>set RecordSet = "that huge sql string"<BR>while not rs.eof<BR> &#060;if container_id is this then add it ..... and stuff&#062; <BR><BR><BR> rs.movenext<BR>wend<BR><BR>that&#039;s how i&#039;d do it in VB. Anyone know how i&#039;d do it in SQL?