Daniel Kessler wrote:

> I'm doing a query for all records that are newer than 7 days.  I
> inserted the date using DateFormat(Now()).  Unfortunately it gives me
> an error that dateAdded is unidentified.  True, it's a column and I
> want it to search the column for anything less than 7 days old.  Can
> anyone help me word this WHERE?
>
> <CFQUERY NAME="whatsnew" DATASOURCE="puhweb">
>       select * FROM whats_new
>       WHERE '#DateDiff("d",dateAdded,the_date)#' < 7
>       order by dateAdded DESC
> </CFQUERY>

<CFQUERY NAME="whatsnew" DATASOURCE="puhweb">
     SELECT *
     FROM whats_new
     WHERE dateAdded > <cfqueryparam cfsqltype="cf_sql_timestamp"
value="#DateAdd("d",-7,Now())#">
     ORDER BY dateAdded DESC
</CFQUERY>

Jochem

--
I don't get it
immigrants don't work
and steal our jobs
     - Loesje
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to