Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2009
    Posts
    14

    Unanswered: Union query: Assistance Required

    Greetings to everyone out there.

    I have a table tblFlavor, which has the list of flavors in it. I use a combo box on a form to select the values from the list. I needed an option "Other" in the combo box so i set the rowsource property of the combo box to
    SELECT flavor FROM tblflavor UNION Select "Other" From tblflavor ORDER BY flavor;

    So the combo box now lists all the values from the tblFlavor table plus the "Other" which I added using the UNION query. Now I want the "Other" to be displayed at the end of the list rather than at the top of the list in the Combo Box.

    Can someone help me about it?

    Regards,
    Sakthivel

  2. #2
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    Add a field to both sections of the UNION, 0 to the first part and 1 to the second, and put your primary sort on that.
    Paul

  3. #3
    Join Date
    Jun 2009
    Posts
    14

    Union Query

    Hi Mr. Paul,

    Thanks very much for the reply.

    SELECT flavor, 0 as Ind FROM tbltestingflavor UNION Select "[None]" ,1 as Ind From tbltestingflavor
    ORDER BY Ind;

    Tried the above SQL and it works. Great !!!
    Thankyou very much.

    Regards,
    Sakthivel
    Last edited by sakthivels; 06-08-09 at 02:13.

Posting Permissions

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