>WHERE dateAdded >= '#dateFormat(dateAdd('d',-7,now()),'mm/dd/yyyy')#'
I guess this works cause it's querying a date field with a date.
Interestingly, it previously had {currentDate()-7}.  Maybe it was
currDate().   I'm updating it.

So now it's doing the query, it's giving me "not a valid month", but
It seems to me that we're adding a date here (subtracting really).
Looks like this is close.

Oh wait, I did:  WHERE dateAdded < #dateAdd("d",-7,Now())#
This seems to have worked.  I removed the dateFormat because as
suggested, it seemed unnecessary.  I also removed the quotes.  I
don't have alot of data to test from but it seems ok.

>WHERE dateAdded >= DATEADD('d',-7,getDate())
well this is ORACLE, but the function looked the same there, though I
didn't look up getDate();
This gave me the error, " invalid column name", though I don't know
why as dateAdded is the right column.  It specifies the top line of
the query with the error.

>WHERE dateAdded >= #createODBCDate(dateAdd('d', -7, now())#
error:
Invalid CFML construct found on line 34 at column 64. (the WHERE line)
ColdFusion was looking at the following text:
#

>assuming (yeah, yeah, i know) that dateAdded is a date/time datatype,
>why the dateFormat() function?
good point.

>WHERE dateAdded > <cfqueryparam cfsqltype="cf_sql_timestamp"
>value="#DateAdd("d",-7,Now())#">

and would this change since it's ORACLE?
sorry folks, I should have mentioned that it was ORACLE.

>I'm doing a query for all records that are newer than 7 days.

whew.

--
Daniel Kessler

Department of Public and Community Health
University of Maryland
Suite 2387 Valley Drive
College Park, MD  20742-2611
301-405-2545 Phone
www.phi.umd.edu
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to