NEED HELP with order of lookup in SQL select statement

Posted on 2006-05-22
Last Modified: 2012-06-27
NEED HELP with order of lookup in SQL select statement

strSQL4 = "SELECT * FROM imlsmst_sql WHERE orig_ord_no = '" & rs("ord_no") & "'"

I need it to search from the end of the table.... Problem is that there are using the orig_ord_no over, so when i bring it up is is bring up the old on.
Question by:kwitcom
    LVL 12

    Accepted Solution

    Hi kwitcom,

    Search from the end of the table?
    Sounds like you need a column you can sort by...

    do you have any auto-identifier/date column you can sort by?
    if so, you can add this to the query:
    ORDER BY <column_name> DESC

    so the final result would be:
    strSQL4 = "SELECT * FROM imlsmst_sql WHERE orig_ord_no = '" & rs("ord_no") & "' ORDER BY ColumnName DESC"

    - Maddog

    Author Comment

    Thnx... Worked....

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
    I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now