var sidebar_align = 'right';
var content_container_margin = parseInt('350px');
var sidebar_width = parseInt('330px');
I need some help with SQL
I have a table with random dates for mulitple accounts between 1990-01-01 and 2007-01-03
For each account, I want to find their latest date before 2005-01-01
ID | Date
I want it to pull just the following
Can someone direct me in the right direction or what functions I need.
Sorry if it is unclear, I hope the example I made makes it more clear.
Thanks in advanced
Try WHERE datefield BETWEEN ('1900-01-01' AND '2004-12-31')
The above is just a quick solution that I know it works. Have you tried doing a simple comparison like " datefield < '2005-01-01' " ?
Last edited by juangake; 01-04-2007 at 03:52 AM.
select id, max(date) from example where date<'2005-01-01' group by id