|
From: Giri sayee on 31 Oct 2006 11:39 Here 's my problem - I need to fetch all files modified after a certain date.I did a Cfdirectory to return all files and tried to do a QoQ to return files modified since yesterday. But date comparsion doesn't not work in QoQ .Has anyone encountered this before? Here's the code I used <cfdirectory name="test" action="list" filter="*.cfm" directory="C:\Resource\Development\ugxs164_MWL_Support\BASE"> <cfset date="10/30/2006"> <cfquery name="test1" dbtype="query"> select * from test where DATELASTMODIFIED > <cfqueryparam value="#dateformat(dt,'mm/d/yyyy')#" cfsqltype="cf_sql_DATE"> </cfquery> Without using Cfquerryparam , i get a Unsupported type comparsion error, but using it didn't work the way i want it to. I also tried Createdatetime but that doesn't work either Can anyone help me? As you can see
From: Dan Bracuk on 31 Oct 2006 13:33 If you do this: <cfdump var="#test#"> what does the datelastmodified field look like?
From: Dark Knight on 31 Oct 2006 13:44 HI, Just wanted to add this. CFQUERYPARAM won't work with Query of Queries. I am using CF 7MX and SQL 2000, and if we use CFQUERYPARAM with data type date, the date comparison operators just did'nt work....
From: Giri sayee on 31 Oct 2006 15:04 Thanks for the reply Dan - But that I forgot to mention that I am working on CFMX 6.1 I guess this would work in CFMX 7. <cfdirectory action="list" name="test" filter ="*.cfm" directory="C:\Resource\Development\ugxs164_MWL_Support\BASE"> <cfset datevar=dateadd("d",-90,now())> <cfquery name ="test1" dbtype="query"> select * from test where datelastmodified < #datevar# </cfquery>
From: Giri sayee on 31 Oct 2006 15:16
[q][i]Originally posted by: [b][b]Dark Knight[/b][/b][/i] HI, Just wanted to add this. CFQUERYPARAM won't work with Query of Queries. I am using CF 7MX and SQL 2000, and if we use CFQUERYPARAM with data type date, the date comparison operators just did'nt work....[/q] Yep you are right .. doesn't seem to work with CFMX 6 either. |