Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
More from the grouping
Message
 
 
To
15/09/2010 16:48:08
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Environment versions
SQL Server:
SQL Server 2008
Application:
Web
Miscellaneous
Thread ID:
01481344
Message ID:
01481364
Views:
23
>>I see, I think I have an idea.
>>
>>Do you store the LastDate processed somewhere and Pass this date to get everything up from that date?
>
>Yes, this is what we rely on. This is sent to the server for each of those10 records. I save in a related table the last LastDate. Then, once the client requests to start the process again, I send the LastUpdate value.
>
>The query can then use that LastUpdate value like this:
>
>
>SELECT RO.FirstName
>FROM (SELECT TOP 10 Event.RO_No,Min(Event.DateTime) AS LastUpdate
> FROM Event
> INNER JOIN RO ON Temp.RO_No=RO.RO_No
> WHERE Event_Log.Event_DateTime>'Something'
> GROUP BY Event.RO_No
> ORDER BY MIN(Event.Datetime)) Temp
>INNER JOIN RO ON Temp.RO_No=RO.RO_No
>
SELECT TOP 10 Event.RO_No,
Min(Event.DateTime) AS LastUpdate,
min(Ro.FirstName) as FirstName
 FROM Event
inner join RO on Event.Ro_No = RO.Ro_No
 WHERE Event.Event_DateTime>'SomDate' GROUP BY Event.RO_No
 ORDER BY MIN(Event.Datetime) 
and not exists(select 1 from Event E where E.DateTim < ='SomeDate' and E.Ro_No = RO.Ro_NO)
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform