Hi,
I have a database that has entries, Date and Tag and Value. It is from a Historian and it only recorded values at certain intervals if they where a certain distance away from the previous value, ie. deadband.
In any case, I'm gathering information on a particular tag for a particular time period but for some tag's, there is no information because the data was not updated within that time period (it hadn't changed a significant amount that it met the deadband limit to record a new entry). As such, I'd like to be able to get the LAST entry for a particular tag (last in terms of date) before the time period i'm looking at. Is there a quick SQL statement I can use? I'm thinking something along the lines of MAX might help...
I've tried:
And this returns the date I want, but not the tag and value (As they aren't aggregate functions it tells me)
Is there a way to modify this so it returns everything I want (date, tag AND value). Or must I do 2 queries. The reason is because any query I run takes atleast 30 miuntes on this access 97 database... (there's too much data...)
Thanks.
Frank
I have a database that has entries, Date and Tag and Value. It is from a Historian and it only recorded values at certain intervals if they where a certain distance away from the previous value, ie. deadband.
In any case, I'm gathering information on a particular tag for a particular time period but for some tag's, there is no information because the data was not updated within that time period (it hadn't changed a significant amount that it met the deadband limit to record a new entry). As such, I'd like to be able to get the LAST entry for a particular tag (last in terms of date) before the time period i'm looking at. Is there a quick SQL statement I can use? I'm thinking something along the lines of MAX might help...
I've tried:
Code:
SELECT max(date)
FROM Frank
WHERE DATE < #03/09/1993#;
And this returns the date I want, but not the tag and value (As they aren't aggregate functions it tells me)
Is there a way to modify this so it returns everything I want (date, tag AND value). Or must I do 2 queries. The reason is because any query I run takes atleast 30 miuntes on this access 97 database... (there's too much data...)
Thanks.
Frank