Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeGetting StartedGetting StartedNew to DNN Plat...New to DNN Plat...How do I resort the States under Host>Lists>States:Region?How do I resort the States under Host>Lists>States:Region?
Previous
 
Next
New Post
11/7/2011 2:49 PM
 
I created a form using DynamicForms and one of the options is to pull in a list of droplist items by running an SQL command.  To get the list of states to appear in my State droplist I ran the following SQL query.  

select Text as QuestionOption, Text as QuestionOptionValue from Lists where ListName= 'Region'

It pulls all the states perfectly.  The problem is I added a new value to the States List (--Select One--).  Instead of appearing at the top of the list it appears alphabetically under Rhode Island.  I want to move it to the top.  Any ideas?

-Sean
 
New Post
11/7/2011 11:19 PM
 
select '< Select Region >' as RegionName
,null as RegionCode
UNION
select Text
,Value
from Lists
where ListName = 'Region'
order by RegionName

Something like that - put it in the SQL

the Order by isn't part of the select statement but is an operation that runs after the records have been selected. So you only include it once, at the end of the union.

The '<' will sort as preceding alpha values, and so this will appear at the top of the list.

pmgerholdt
 
Previous
 
Next
HomeHomeGetting StartedGetting StartedNew to DNN Plat...New to DNN Plat...How do I resort the States under Host>Lists>States:Region?How do I resort the States under Host>Lists>States:Region?


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out