Hello guys,
I have a DB table where the date is represented in 6 separate integer fields/columns (year, month, day, hour, minute, second). Don't ask me why and please do not tell me to change the column types... It's something I have no control over. Now my question is, how do I create a query to select all records between 2 dates in this table?
I've tried this but it doesn't return the right records.
Any help is greatly appreciated.Code:"Select * from tablename where (yr >= @year1 and month >= @month1 and day >= @day1) and (yr <= @year2 and month <= @month2 and day <= @day2)




Reply With Quote