[ANSWER]
Thanks everyone! The code to solved the problem below is:
SELECT ID
FROM Schedule
WHERE (SUBSTRING(Time, 1, 2) = DATEPART(hh, GETDATE()))
How to select the first two character in SQL Server CE?
For example:
+-----+-----------+------------+
+ Day + Time + ID +
+-----+-----------+------------+
+ 1 + 08:00:00 + A1 +
+ 1 + 09:00:00 + A2 +
+ 1 + 09:30:00 + A3 +
+ 1 + 10:15:00 + A4 +
+-----+-----------+------------+
Time column is a nvarchar type.
Then, I want to select the ID only with the time based on the real-hour, like only select the 08 part from 08:00:00. How can I do that?
SUBSTRING is available in CE – http://msdn.microsoft.com/en-us/library/aa275646(SQL.80).aspx