EasyCFM.COM ColdFusion Forums / Coding Help! / valueList not giving the right order

   Reply to Discussion | New Discussion << previous || next >> 
Posted By Discussion Topic: valueList not giving the right order

book mark this topic Printer-friendly Version  send this discussion to a friend  new posts last

donboe
11-13-2011 @ 11:49 AM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Senior Member
Posts: 472
Joined: Nov 2004

Hi all, I have problems getting the right order (first Month than Day) in a valueList. This is the queries i'm using.


<cfquery name="getListing" datasource="#Application.dsn#">
  SELECT
         CL.category_id
    ,     CL.category_icon
    ,     CL.category_sequence
    ,     CL.category_isActive                  
    ,     C.language_abbr
    ,     C.category_name
    ,     CH.photo
    ,     AL.activity_id
    ,     A.language_abbr
    ,     A.activity_name
    ,     A.activity_title
    ,     A.activity_description
    ,     DATE_FORMAT( activity_date, '%d/%m') AS newDate
    ,     AD.activity_date
  FROM
      category_list CL
  INNER
    JOIN categories C
      ON CL.category_id = C.category_id
     AND C.language_abbr = <cfqueryparam cfsqltype="cf_sql_char" value="#Trim( Session.language )#" />    
  LEFT
    JOIN category_headers CH
      ON CL.category_id = CH.category_id
  INNER
    JOIN activity_list AL
      ON CL.category_id = AL.category_id
  INNER
    JOIN activities A
      ON AL.activity_id = A.activity_id
  AND    A.language_abbr = <cfqueryparam cfsqltype="cf_sql_char" value="#Trim( Session.language )#" />            
  INNER
    JOIN      activity_dates AD
      ON     AL.activity_id = AD.activity_id                 
  ORDER
      BY category_sequence, activity_name,  MONTH(AD.activity_date), DAY(AD.activity_date)                                            
</cfquery>
<cfquery name="getDates" dbtype="query">
  SELECT
      DISTINCT newDate
  FROM
               getListing
</cfquery>
<cfset result = valueList ( getDates.newDate, ", " )>


But no matter what I do in the cfoutput it keeps ordering by Day instead of first Month followed by Day

“Good artists copy, great artists steal.” (Papblo Picasso)

Webmaster
11-22-2011 @ 11:37 AM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Administrator
Posts: 4533
Joined: Jan 2002

Add an "Order by" to your query of query... let me know.

Pablo Varando
Senior Application Architect
EasyCFM.COM, LLC.

904.483.1457 \\ mobile
webmaster@easycfm.com \\email

\m/ (>.<) \m/
--- rock on ---

donboe
11-23-2011 @ 4:24 AM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Senior Member
Posts: 472
Joined: Nov 2004

I tried Pablo without any result. This is the page I'm referring to  Listing but the funny thing is on the detail page (See here) it's working fine and I'm using the exact same queries.

What am I doing wrong

“Good artists copy, great artists steal.” (Papblo Picasso)

Webmaster
12-08-2011 @ 10:00 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Administrator
Posts: 4533
Joined: Jan 2002

not sure... i would say re-set the order in the query of
query and it should work fine..

Pablo Varando
Senior Application Architect
EasyCFM.COM, LLC.

904.483.1457 \\ mobile
webmaster@easycfm.com \\email

\m/ (>.<) \m/
--- rock on ---

Sponsored By...
iOpenSoft, LLC is a Houston, Texas Advanced Technology Studio Specializing in Web Design, Web Development, iPhone App Development and Android App Development.