[thelist] ASP: SQL Select records within 1 week.

Christian Anderson lists at photokyo.com
Mon Apr 12 05:30:13 CDT 2004


Hi,
 
I'm trying to select the most viewed records from my database over the last
week, but am running into a problem. Here is the string that I am using:
 
SQL=("SELECT TOP 5 * FROM t_cameraphone WHERE dDATE > '" &
DateAdd("D",-7,Now()) & "' ORDER BY tVIEWS desc;")
 
The DateAdd function is going back 7 days from now, and I think this SHOULD
give me the records that are newer than that date... but I get the following
error:
 
Microsoft JET Database Engine error '80040e07' 

Data type mismatch in criteria expression. 

Any ideas how to make that statement work? I tried taking out the ' around
the dateadd thing, but that didnt work...

 
Christian Anderson
Niseko Hirafu, Hokkaido, Japan
http://www.photokyo.com <http://www.photokyo.com/> 
 



More information about the thelist mailing list