Hi there.
I have a page on a website I am building where is want to look for all
records added in the last 60 days.
The date is added in short UK format, that is 25/12/2003 in an access
database. (set as a date field)
I am using <% session.lcid=2057 %> in my header to force UK date format.
My problem is, everything seems to be correct, but the query just returns
all records in the table.
The SQL query is
if request("lookup") = "latest" then
recent = FormatDateTime(Now()-60,vbShortDate)
end if
if request.querystring("lookup") = "latest" then
myquery="SELECT * FROM Property WHERE datein > " & recent & " ORDER BY
datein DESC"
else
myquery="SELECT * FROM Property WHERE department LIKE '%" &
request.querystring("lookup") & "%' AND pricefaieuro > " & MinPrice & " AND
pricefaieuro < " & MaxPrice & " ORDER BY reference DESC"
end if
The SQL output via response.write seems to be correct (see following)
SELECT * FROM Property WHERE datein > 07/10/2003 ORDER BY datein DESC
(I have also tried WHERE NOT datein < " & recent &" ........)
Does anyone know what the proplem may be. I have been looking at this for
hours now and last night and am no closer to fixing it.
Thanks in advance
Simon