ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

orderby custom field (number)

July 12, 2011 7:21pm

Subscribe [1]
  • #1 / Jul 12, 2011 7:21pm

    Michael Hahn

    316 posts

    Does anyone know how to orderby a custom field thats populated with numbers. (IE price) Either through a addon or changing the mysql field to integer or numeric.

    The EE orderby parameter works but because it’s a text field it doesn’t read the integer correctly.

    Exploring the database it seems that changing the type would effect ALL custom fields, not just the specific one im trying to target. I couldn’t find a FieldFrame field type out there either.

    Thanks

  • #2 / Jul 12, 2011 8:39pm

    Michael Hahn

    316 posts

    N/M, I was looking at the wrong database field.

  • #3 / Jul 13, 2011 3:00pm

    Lisa Wess

    20502 posts

    Hey Michael, been awhile since I’ve seen you here.  I hope you’re doing well!

    You’ve got this all sorted out now?

  • #4 / Jul 13, 2011 4:02pm

    Michael Hahn

    316 posts

    Hi Lisa, all is well thanks.

    Actually I only have half of this sorted out. I changed the custom field to INT and now I’m trying to get the field to format properly with commas. Do you know if the query module accepts the FORMAT function? I can’t seem to get it to work. Or any other suggestions you may have. Thanks Mrs. Senior Director of Operations 😊

  • #5 / Jul 13, 2011 5:33pm

    Lisa Wess

    20502 posts

    Hi Michael,

    Ms, not Mrs. But that’s ok. =)

    The query module is limited to certain functions.  If you need to do more with it, it may b best to use direct SQL or PHP to format your results.

    Did you want me to move this to community help to get some assistance with that?

  • #6 / Jul 13, 2011 5:40pm

    Michael Hahn

    316 posts

    Thanks Lisa

    Yeah thats what I thought. If you want to move it over I’ll try to post something once I build the query.

    Thanks for your help

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases