There's the rub - it comes from a call to cfdirectory. I'm trying to
retrieve a list of files and then reorder them. The file names themselves
contain a date, so the files are named "xxx_122004.pdf", etc. What I want
to do is run a substring to parse out the month and year and then order by
them. So the final code would be something like:
<cfquery dbtype="query" name="qryFiles">
SELECT *,
SUBSTRING(name, 5, 2) AS month,
SUBSTRING(name, 7, 4) AS year
FROM qryFiles
ORDER BY year DESC, month DESC
</cfquery>
Obviously that won't work in QoQ :(
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
Of Adam Cameron
Sent: Friday, March 18, 2005 8:15 AM
To: [email protected]
Subject: RE: [CFCDev] OT: QoQ Substring?
Can you expand why you need to do this in the QoQ? I'm not saying you
shouldn't be, but by explaining the requirement, it might make it easier to
come up with the solution.
Firstly... you can't do what you want in QoQ, so stop trying. There are
very few scalar functions in QoQ, and I think the only string ones are
upper() and lower() (or toUpper() / toLower(), I forget, and the BNF in the
docs doesn't mention them). CF states there's a whole bunch of reserved
words with QoQ, but I suspect those are reserved by JDBC, not QoQ per se.
So. Alternatives.
1) the query you're querying must have come from somewhere. Do the substr()
processing when building that query (either with the DB engine, or in your
querySetCell() code).
2) I'm guessing you're iterating over this query at some point. use mid()
as you do so to come up with value you need.
I guess depending on what you're wanting to do, those options might not be
viable.
--
Adam
This email contains confidential information. If you are not the intended
recipient of this email, please notify Straker Interactive and delete the
email. You are not entitled to use it in any way.
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to
[email protected] with the words 'unsubscribe cfcdev' as the subject of the
email.
CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting
(www.cfxhosting.com).
An archive of the CFCDev list is available at
www.mail-archive.com/[email protected]
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to
[email protected] with the words 'unsubscribe cfcdev' as the subject of the
email.
CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting
(www.cfxhosting.com).
An archive of the CFCDev list is available at
www.mail-archive.com/[email protected]