Hey,
I have a query that is Concatenating 2 select statements into 1 result set. I now need to sort them together.
This is the query:
That query is returning the correct results, but now I need them sorted together. The concat just puts one select results after the other. The Time field is a DateTime and that's what I need to sort on.
I've read several pages on the subject and I'm stumped. can someone give me an easy explanation of how to do this?
Thanks
Travis Hawkins
jobs.bestcodingpractices.com
I have a query that is Concatenating 2 select statements into 1 result set. I now need to sort them together.
This is the query:
Code:
Dim fRem = ((From r In db.Reminders _
Where r.CreatedBy = ui.UserID _
Select ID = r.ID.ToString, Name = r.Name, Time = r.ReminderQueues.FirstOrDefault.Time, _
TimeZone = r.TimeZone, CarrierID = r.ReminderQueues.FirstOrDefault.Carrier.ToString, _
CalID = r.ReminderQueues.FirstOrDefault.CalendarID.ToString _
Order By Time _
).Take(5)).Concat( _
(From c In db.Appointments _
Where c.UserID = ui.UserID And _
Not (From r2 In db.ReminderQueues _
Select r2.CalendarID).Contains(c.ID) _
Select ID = "0", Name = c.Subject, Time = c.StartTime, _
TimeZone = "EST", CarrierID = "", CalID = c.ID.ToString _
Order By Time)).Take(5)
That query is returning the correct results, but now I need them sorted together. The concat just puts one select results after the other. The Time field is a DateTime and that's what I need to sort on.
I've read several pages on the subject and I'm stumped. can someone give me an easy explanation of how to do this?
Thanks
Travis Hawkins
jobs.bestcodingpractices.com