Hi
i have the following records:
ROWID,SUPPLIER,VALIDFROM,VALIDTO,VALUE
1, PEPE JEANS, 01OCT09,31DEC09,$1000
2, CK, 11OCT09,31DEC09,$850
3, PEPE JEANS, 10OCT09,31DEC09,$800
4, CK, 12OCT09,31DEC09,$800
5, CK, 20OCT09,31DEC09,$800
6, PEPE JEANS, 01NOV09,31DEC09,$750
So I need to do a search by a date (example 12OCT09 based on VALIDFROM date) so the query should return:
2 CK, 11OCT09,31DEC09,$850
3 PEPE JEANS, 10OCT09,31DEC09,$800
which are the valid records on that date.
So another example, if I put date 12DEC09, I shoud get back:
5 CK, 20OCT09,31DEC09,$800
6 PEPE JEANS, 01NOV09,31DEC09,$750
I have tried GROUP BY, SORT BY LIMIT, COUNT(*) (a combination of those) and cannot get this to work !
could anyone help me ?
i have the following records:
ROWID,SUPPLIER,VALIDFROM,VALIDTO,VALUE
1, PEPE JEANS, 01OCT09,31DEC09,$1000
2, CK, 11OCT09,31DEC09,$850
3, PEPE JEANS, 10OCT09,31DEC09,$800
4, CK, 12OCT09,31DEC09,$800
5, CK, 20OCT09,31DEC09,$800
6, PEPE JEANS, 01NOV09,31DEC09,$750
So I need to do a search by a date (example 12OCT09 based on VALIDFROM date) so the query should return:
2 CK, 11OCT09,31DEC09,$850
3 PEPE JEANS, 10OCT09,31DEC09,$800
which are the valid records on that date.
So another example, if I put date 12DEC09, I shoud get back:
5 CK, 20OCT09,31DEC09,$800
6 PEPE JEANS, 01NOV09,31DEC09,$750
I have tried GROUP BY, SORT BY LIMIT, COUNT(*) (a combination of those) and cannot get this to work !
could anyone help me ?