costarica1
Programmer
I have a program I wrote that copies some images and a text report to a folder each day to archive them. Now I have a list that spans since last may of each days report. Its starting to be a lot of entries and time to organize it better. An example of the directories is posted here:
So I list it with this:
<cfdirectory directory="#archives_location#" action="list" name="archives" sort="datelastmodified">
Then display with this:
<cfset counter = 0>
<cfoutput query="archives"><!--- Outputs the list of folders in the archives area. --->
<cfif archives.name neq "Copy-this">
<cfif counter eq 20>
</td>
</cfif>
<a href="../daily_archive/#archives.name#/">#archives.name#</a><br>
<cfset counter = counter + 1>
<cfif counter eq 20>
<cfset counter = 0>
<td>
</cfif>
</cfif>
</cfoutput>
Basically, I just need help sorting the dates ( the "datelastmodified" sort in the Cfdir tag isn't working how I would have hoped ) and also how I would query that list from a cfquery tag. My friend suggested this, but it threw me an error.
<cfdirectory directory="#archives_location#" action="list" name="archives" sort="datelastmodified">
<cfquery name="dircon" dbtype="query">
select *,
left(name,2) as mVal,
right(left(name,5),2) as dVal,
right(name,2) as yval
from archives
order by yval asc, mval desc, dval desc
</cfquery>
So I list it with this:
<cfdirectory directory="#archives_location#" action="list" name="archives" sort="datelastmodified">
Then display with this:
<cfset counter = 0>
<cfoutput query="archives"><!--- Outputs the list of folders in the archives area. --->
<cfif archives.name neq "Copy-this">
<cfif counter eq 20>
</td>
</cfif>
<a href="../daily_archive/#archives.name#/">#archives.name#</a><br>
<cfset counter = counter + 1>
<cfif counter eq 20>
<cfset counter = 0>
<td>
</cfif>
</cfif>
</cfoutput>
Basically, I just need help sorting the dates ( the "datelastmodified" sort in the Cfdir tag isn't working how I would have hoped ) and also how I would query that list from a cfquery tag. My friend suggested this, but it threw me an error.
<cfdirectory directory="#archives_location#" action="list" name="archives" sort="datelastmodified">
<cfquery name="dircon" dbtype="query">
select *,
left(name,2) as mVal,
right(left(name,5),2) as dVal,
right(name,2) as yval
from archives
order by yval asc, mval desc, dval desc
</cfquery>