Any way to use a custom SQL statement but order the results (ORDER BY)
Last Post 05-20-2013 08:03 AM by Ryan Bakerink. 5 Replies.
AddThis - Bookmarking and Sharing Button
Author Messages Resolved
Scott PetersonUser is Offline
skipping stones
skipping stones
Posts:11
Avatar

--
05-10-2013 09:37 AM

    I would be very interested to see if there is anyway supported that would allow me to run my query but be able to set the order.

     

    I currently have implemented an instance of the view module and I was initially happy with the provided sort feature (sort field and sort order) but I now have a need where I need to be able to sort on additional columns.

     

    In my particular case I want to first sort on a column that lists Supplier Names and then I want to sort by a date column and want the newest dates to be shown first.

    Ryan BakerinkUser is Offline
    river guide
    river guide
    Posts:1900
    Avatar

    --
    05-10-2013 10:13 AM
    Hello Scott,

    Let's say this is your Custom SQL Query for your Dynamic View:

    Select * from YourTable


    You'll need to append the Order by Clause:

    Select * from YourTable Order By SupplierName ASC, DateColumn DESC

    Let me know if this works for you.

    If it doesn't then please select the Columns that you wish to sort. In Dynamic Views there's the option to select a column to sort by(ASC or DESC) and a Secondary column(ASC or DESC).

    Please let me know if you have any questions.

    Thanks,

    Ryan
    Scott PetersonUser is Offline
    skipping stones
    skipping stones
    Posts:11
    Avatar

    --
    05-10-2013 10:58 AM
    Ryan,

    Thank you for your prompt response.

    I am encouraged by your answer but I must be missing something as I have already tried what you suggest and I do not get could results.

    I am using version 3.0.10 on DNN 6.2

    “If it doesn't then please select the Columns that you wish to sort. In Dynamic Views there's the option to select a column to sort by(ASC or DESC) and a Secondary column(ASC or DESC).”
    [Scott] in the settings I only see Sort Field and Sorting Order.  I do not see any additional way to add or set another column to sort on.  Am I on an older version maybe?

    With settings CustomSQL, “Allow form Query” not checked I can use a simple SQL like SELECT * FROM Certification.  An example of a publicly available page on my site http://www.himsa.com/Products/NoahM...fault.aspx

    As soon as I append my SQL to be “SELECT * FROM Certification Order By Supplier ASC” then the table is populated with no results.

    If I change “Allow form Query” to be checked and set the sql to be “SELECT * FROM Certification Order By Supplier ASC” then my table will be populated but it will not be sorted as I have specified.  It will be sorted by the row ID from the table.
    Ryan BakerinkUser is Offline
    river guide
    river guide
    Posts:1900
    Avatar

    --
    05-16-2013 08:11 AM
    Hello Scott,

    I feel as though you're missing a small step in which I'm unable to identify directly through our conversation via these forums.

    Could you send me temporary admin rights? Please email them to me at rbakerink(at)datasprings(dot)com.

    Please let me know if you have any questions.

    Thanks,

    Ryan
    Scott PetersonUser is Offline
    skipping stones
    skipping stones
    Posts:11
    Avatar

    --
    05-20-2013 04:40 AM

    Ryan,


    I very much appreciate your extra assistance with my problem. I must've missed something very simple but am now very happy that I have the module now working just as I wanted.

    Ryan BakerinkUser is Offline
    river guide
    river guide
    Posts:1900
    Avatar

    --
    05-20-2013 08:03 AM
    Great to hear that we could be of assistance.

    If you enjoyed the support that you received, we would greatly appreciate if you could time the time to post a review for us on store.dotnetnuke.com. Please log into the account used to purchase Dynamic Views. By receiving reviews from our customers, this helps us stand out in the DNN Market. Sometimes customer decisions hang on a thread based off of reviews received for a specific product.

    Please let us know if you ever have any questions.

    Thanks,

    Ryan


    ---
  • film izle
  • 720 izle
  • film
  • sinema izle
  • film makinesi
  • T�rk�e dublaj film
  • film izle
  • film izle
  • baglan film izle
  • sinema izle
  • 1080 film izle
  • film mercegi