ListGetAt in CFQUERY

Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.

  1. #1

    Default ListGetAt in CFQUERY

    I have a database of computer components that helps drive a custom system
    builder. I have 1 price field that has a list of prices delimited with an
    underscore so that there can be multiple prices for the same component. The
    values can be a price, 0 or na like 45.00_na_0.00_83.00_na_75.00. I have been
    using the ListGetAt function to access the appropriate price for outputs, if
    statements and to create variables with no problem. My question is Can I use
    ListGetAt as part of a SELECT statement or ORDER BY clause in CFQUERY. I have
    tried some variations with no success. There is always a Sys_ID number passed
    as part of the URL linking to this script so that choosing the appropriate item
    in the list is easy enough. I want to access the appropriate item to use for
    the ORDER BY clause. For example ... SELECT ListGetAt(Part_Wholesale,
    url.Sys_ID, '_') AS Part_Price ORDER BY Part_Price OR ORDER BY
    ListGetAt(Part_Wholesale, url.Sys_ID, '_') Thanks Larry

    Web Mountaineer Guest

  2. Similar Questions and Discussions

    1. cfquery bug...still?
      Hi, I have ColdFusion MX7,0,0,91690. I am trying to utilize the attached code. I am passing the query (it's easier for my implementation) in a...
    2. Problem with function ListGetAt
      I have written the code for a DB driven image viewer. It is pretty simple. I am having a problem with my navagtion going to the previous and next...
    3. cfquery
      I am trying to use debug in a query and it is a no go(should show at bottom of page). the query is working because I am getting recordcounts. Then...
    4. need help with cfquery
      This should be an easy one ... unfortunately I am a n00b to sql and CF. I am trying to display a certain column in a table, the most recent one. I...
    5. CFQUERY with IF THEN ELSE
      I have a CFQUERY which works perfectly and now I would like to add a little date calculation to this query to filter it little more. The query is a...
  3. #2

    Default Re: ListGetAt in CFQUERY

    Hi Larry

    Looks like you're just missing the # marks around the ListGetAt function.

    Zoe


    SELECT #ListGetAt(Part_Wholesale, url.sys_id, "_")# AS Part_Price
    FROM tableName
    ORDER BY #ListGetAt(Part_Wholesale, url.sys_id, "_")#

    zoeski80 Guest

  4. #3

    Default Re: ListGetAt in CFQUERY

    listgetat is a CF function and thus you can't use it as a db function

    You can do this

    Select *
    From table
    Where column = ListGetAt()

    But you can't do what you want to do, this is because the cf can't determine
    what's in the column untill it is returned from the query.

    You need to either find some db functions (for the db your using) or apply the
    listgetat function when outputting the recordset.

    Ken

    The ScareCrow Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139