I have this view:
SELECT MAX(DERIVEDTBL.[Time]) AS Time, DERIVEDTBL.[Value], DERIVEDTBL.Date, MIN(DISTINCT DERIVEDTBL.Name) AS name
FROM (SELECT *
FROM f_view -- another view
WHERE (Date =
(SELECT MAX(date) AS maxdate
FROM f_view v
WHERE v.name = f_view.name))) DERIVEDTBL
GROUP BY Date, Type, Status, [Value]
HAVING (Status = 0) AND (Type = 0)
My query:
Select value, time from sample_view where name = Marianne' AND date BETWEEN '2006-02-01' AND '2006-02-28' group by name, value
I would like to have this value:
time |value |date |name
---------------------------------------------------
2006-03-28 14:01:28.123 109.81 2006-02-28 Marianne
And I have this two value if even I did the max of time.
time |value |date |name
----------------------------------------------------
2006-03-28 14:01:28.123 109.81 2006-02-28 Marianne
2006-03-27 14:41:07.167 261.6 2006-02-28 Marianne
When I insert in my query the column value I have this two record displayed.
I tried to do the max of time but I have all the time the same result.
Thank you in advance
Inarobis
SELECT MAX(DERIVEDTBL.[Time]) AS Time, DERIVEDTBL.[Value], DERIVEDTBL.Date, MIN(DISTINCT DERIVEDTBL.Name) AS name
FROM (SELECT *
FROM f_view -- another view
WHERE (Date =
(SELECT MAX(date) AS maxdate
FROM f_view v
WHERE v.name = f_view.name))) DERIVEDTBL
GROUP BY Date, Type, Status, [Value]
HAVING (Status = 0) AND (Type = 0)
My query:
Select value, time from sample_view where name = Marianne' AND date BETWEEN '2006-02-01' AND '2006-02-28' group by name, value
I would like to have this value:
time |value |date |name
---------------------------------------------------
2006-03-28 14:01:28.123 109.81 2006-02-28 Marianne
And I have this two value if even I did the max of time.
time |value |date |name
----------------------------------------------------
2006-03-28 14:01:28.123 109.81 2006-02-28 Marianne
2006-03-27 14:41:07.167 261.6 2006-02-28 Marianne
When I insert in my query the column value I have this two record displayed.
I tried to do the max of time but I have all the time the same result.
Thank you in advance
Inarobis