Hello, I really need some help with an SQL statement. Can anyone help please? I'm using MSSQL 2K.
Here's what I've got so far... DECLARE @userid AS int SET @userid = 3 DECLARE @data AS nvarchar(30) SET @data = 'car' SELECT DISTINCT Adverts.Identifier FROM Adverts WHERE Adverts.FK_Users = @userid UNION SELECT DISTINCT Adverts.Identifier FROM Groups INNER JOIN Users_Groups_Link ON Users_Groups_Link.FK_Groups = Groups.PK_ID INNER JOIN Adverts ON Adverts.FK_Users = Users_Groups_Link.FK_Users WHERE Groups.Administrator = (SELECT Users.Forename FROM Users WHERE Users.uID = @userid) Now there's a many table called [Advert_Fields] related to the [Adverts] table. I also need to include that table in the SQL and query on Advert_Fields.Data LIKE %@data%. I only want to return the rows in Adverts who's related many records has @data contained in the Advert.Data field. I hope this make sense! Thanks for any assistance! I'll be back on this in the morning - couple of hours. :) Nick --- You are currently subscribed to activeserverpages as: [email protected] To unsubscribe send a blank email to [EMAIL PROTECTED]
