What i was doing was using DE() to output variables in a string (block of
content).  One of the vars is a date and i wanted to format the date.  What
i was doing was doing some date formatting in the SQL statement but because
of the limitation of the SQL data functions i couldnt do it, like i wanted
"dddd dd mmmm yyyy".  What i wanted to do was just loop over the quert and
do a querySetCell() and just format the date and put it back into the
column.  It formatted the date but ofcourse when it went back into the query
it was just a date object again so defeated the purpose.

What i ended up doing was just formatting the date as much as i could in the
SQL and then using the loop and formatting the date again with
querySetCell() but it only worked because the date value coming from the
query was already a string, not a date.  CF was able to use dateFormat()
with the date coming from the query and because the column was a string type
as a resulto f the previous formatting in the SQL statement, it retained its
string data type and i was able to insert into the cell the desired format
for the date.

Steve

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf
Of Barry Beattie
Sent: Tuesday, 16 December 2008 10:44 PM
To: [email protected]
Subject: [cfaussie] Re: Changing the data type of a column


> Why not do it in the query select statement by adding a column
> expression to format the date there?

the way I read it, Steve is trying to squeeze a bit of code inbetween
an untouchable SQL statement returning a query and some code further
downstream to consume that query. You're right tho, if the world was
your oyster the a Convert() on the select statement would be the way
to go. Perhaps two references in the SQL for that DateTime field: the
second as a string representation of it.

or maybe it's not a query created from a database call itself? I can't
remember, but does CFDirectory.dateLastModified return a proper
DateTime value?


> As for querySetCell(), I don't think that's possible.

I didn't think it was either. Good for creating values when used with
QueryAddRow() but IIRC, a query object returned is read-only (hence
the idea of using QofQ for data conversion)




--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"cfaussie" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/cfaussie?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to