回答編集履歴
1
DateValueを失念していたので、訂正
answer
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
from Table1 as t1
|
5
5
|
inner join table2 as t2
|
6
6
|
on t1.id=t2.id
|
7
|
-
and t1.keydate =
|
7
|
+
and t1.keydate = DateValue(t2.time)
|
8
8
|
and t1.starttime > t2.time
|
9
9
|
where t2.data_value >= 5
|
10
10
|
group by t1.ID, t1.Keydate, t1.starttime
|
@@ -17,7 +17,7 @@
|
|
17
17
|
from Table1 as t1
|
18
18
|
inner join table2 as t2
|
19
19
|
on t1.id=t2.id
|
20
|
-
and t1.keydate =
|
20
|
+
and t1.keydate = DateValue(t2.time)
|
21
21
|
and t1.starttime > t2.time
|
22
22
|
where t2.data_value >= 5
|
23
23
|
group by t1.ID, t1.Keydate, t1.starttime
|