Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing the First and LAST Records

Status
Not open for further replies.

Jesus4u

Programmer
Feb 15, 2001
110
US
Here is the data that needs to be transformed.

Take a look at IP 10.10.2.191. The code I already have adds the tid with the GUID that you see there. What I also need the code to do is seek out that last record 'crmresourcesthankyou.asp' and assign the SAME tid=52FC441. See what I mean?

CODE:
Code:
	UPDATE W 	
	SET PageRequested=PageRequested + '?tid=' + CONVERT(varchar(250), LEFT(NEWID(), 7))
	FROM WebLog W INNER JOIN 
		(SELECT IP, Min(ID) AS MinID FROM WebLog 
		WHERE  [Date]=(SELECT max([Date]) FROM WebLog) 
		GROUP BY IP)
	as Y 
	ON W.ID=Y.MinID

sc.jpg
Exams Passed: 70-152, 70-175, 70-176
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top