mkidd-Repairclinic
-
2/1/2013 12:01:04 PM
From Drop-down list SQL-- can;t get "order by" to work
I set up a form with a drop-down list that pulls user names. It started out simply:
SELECT FullName,FullName FROM dbo.CMS_User
This works fine, but I needed to hide users that are marked as "hidden". So I tried this:
SELECT FullName,FullName FROM dbo.CMS_User WHERE UserIsHidden = 0
That leaves out hidden users in the dropdown list as it should, but the names are out of alpha order. So I tried this:
SELECT FullName,FullName FROM dbo.CMS_User WHERE UserIsHidden = 0 ORDER BY FullName
I believe this is proper SQL-- it works in a MS SQL Server query, but the page that shows the form gives this error:
[Error loading the FormControl ''] [DataConnection.HandleError]: Query: Select FullName,FullName from dbo.CMS_User where UserIsHidden = 0 Order by FullName: caused exception: Ambiguous column name 'FullName'.
How can I get this working?
Thanks for your help.
|