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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multiple records to one record

Status
Not open for further replies.

hlybbi

Programmer
Mar 19, 2003
91
0
0
IS
i have a question
is it possible to read multiple records and update it to one record?
I have this code and i need to find all records that match my query and put them all in one record

<code>
UPDATE #tmpSearchTable
SET Monday = SchedulerEvents.Title+'<br/>x'

FROM SchedulerRecurrence RIGHT OUTER JOIN
SchedulerEvents ON SchedulerRecurrence.EventID = SchedulerEvents.EventID
WHERE DATEPART(hour, SchedulerEvents.StartTime) = DATEPART(hour, @DateTime)
AND DATEPART(minute, SchedulerEvents.StartTime) = DATEPART(minute, @DateTime)
AND SchedulerRecurrence.weekDays=2
AND #tmpSearchTable.Timi=@DateTime
AND EventType=@Company

OR
DATEPART(hour, SchedulerEvents.StartTime) = DATEPART(hour, @DateTime)
AND DATEPART(minute, SchedulerEvents.StartTime) = DATEPART(minute, @DateTime)
AND dbo.GetWeekdayNames(SchedulerRecurrence.weekDays) like '%Monday%'
AND #tmpSearchTable.Timi=@DateTime
AND EventType=@Company
END
</code>

Best regards Hlynur
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top