Results 1 to 2 of 2

Thread: Sorting..

  1. #1
    Fion Guest

    Default Sorting..

    I wish to know how I can trigger sql statements according to what I clicked. ie.. button "Sort by Date" trigger sql statement to order records by Date/Time ,button "Sort by Amount" to trigger sql statement to order records by Amount.<BR><BR>Please enlighten or provide a sample.<BR>Your help is greatly appreciated

  2. #2
    Join Date
    Dec 1969

    Default RE: Sorting..

    Here is one way of doing it.<BR><BR>You create a form that posts back to whatever page you are on.<BR>Create two submit buttons. Name one Date the other Amount.<BR><BR>At the top of your page you have an if then statement:<BR><BR><BR>strSQL = "Select * from tablename" &#039This would be your default &#039string when you open the page)<BR>&#039next are two if then statements that change the sort order if either button is pushed<BR>If Not IsEmpty(Request("Date") Then<BR> strSQL = "Select * from tablename Sort By Date"<BR>End If<BR><BR>If Not IsEmpty(Request("Amount") Then<BR> strSQL = "Select * from tablename Sort By Amount"<BR>End If<BR><BR>&#039then you open your recordset<BR> strSQL,DBConn,2,2<BR><BR>If you need more details email me at<BR><BR>Hope this helps<BR><BR>Dennis Branson

Posting Permissions

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