Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7786121
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T20:21:55+00:00 2026-06-01T20:21:55+00:00

Running this query in the SQLManagement studio returns a result set of 162 Rows

  • 0

Running this query in the SQLManagement studio returns a result set of 162 Rows

SELECT order_num, 
       status, 
       ship_date, 
       cust_ord_num, 
       weight, 
       carrier_desc, 
       consignee, 
       cases 
FROM   v1oemf 
WHERE  ACCOUNT = 'NESTLE' 
       AND status LIKE '%Shipped%' 
       AND ( ship_date BETWEEN '20120327' AND '20120403' ) 

which I got from echoing the results of this code on my PHP page

echo "SELECT Order_num,Status,Ship_date,Cust_ord_num,Weight,Carrier_desc,Consignee,Cases FROM V1OEMF  WHERE Account = '" . $_POST['account'] . "' AND Status LIKE '%". $_POST['custstat'] ."%' AND (Ship_date BETWEEN '".$_POST['start_date']."' AND '".$_POST['end_date']."')";
$rs=odbc_exec($link,"SELECT Order_num,Status,Ship_date,Cust_ord_num,Weight,Carrier_desc,Consignee,Cases FROM V1OEMF WHERE Account = '" . $_POST['account'] . "' AND Status LIKE '". $_POST['custstat'] ."' AND Ship_date BETWEEN '".$_POST['start_date']."' AND '".$_POST['end_date']."'");

the result set of the PHP based Query is 0 rows, and I cannot for the life of me see the issue…

here is the whole section that is supposed to build a table of the results

$rs=odbc_exec($link,"SELECT Order_num,Status,Ship_date,Cust_ord_num,Weight,Carrier_desc,Consignee,Cases FROM V1OEMF WHERE Account = '" . $_POST['account'] . "' AND Status LIKE '". $_POST['custstat'] ."' AND Ship_date BETWEEN '".$_POST['start_date']."' AND '".$_POST['end_date']."'");
                                $num = odbc_num_rows($rs);
                                echo $num;
                                echo "<table>";
                                echo "<thead><tr class='header'>";
                                echo "<td>Order #</td><td>Status</td><td>Ship Date</td><td>Sales Order #</td><td>Consignee</td><td>Carrier</td><td>Cases</td><td>Weight</td>";
                                echo "</tr></thead>";
                                while (odbc_fetch_row($rs)) {
                                                         echo "<tr><td id='f1'><a class='ow' href='' id='" . odbc_result($rs,'Order_num') . "'>" . odbc_result($rs,'Order_num') . "</a></td><td id='f2'>" . odbc_result($rs,'Status') . "</td><td id='f3'>" . odbc_result($rs,'Ship_date') . "</td><td id='f5'>" . odbc_result($rs,'Cust_ord_num') . "</td><td id='f6'>" . odbc_result($rs,'Consignee') . "</td><td id='f7'>" . odbc_result($rs,'Carrier_desc') . "</td><td id='f8' align='right'>" . odbc_result($rs,'Cases') . "</td><td id='f9' align='right'>" . odbc_result($rs,'Weight') . "</td></tr>";
                                                         }
                                echo "</table>";
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T20:21:56+00:00Added an answer on June 1, 2026 at 8:21 pm

    You’ll be needing % around $_POST['custstat'] if you want it to do a LIKE as in your first SQL statement.

    You have them in the echo, but not in the actual SQL.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am running this mysql query: $result = mysql_query(SELECT * FROM userdetails WHERE userid=
I'm running this query: SELECT TOP 1 [DVD Copy].[Stock No] FROM [DVD Copy] WHERE
I'm new to MySQL, and I'm running this query, SELECT item_id,amount FROM db.invoice_line WHERE
I'm running Mysql 5.0.77 and I'm pretty sure this query should work? SELECT *
I am running this query SELECT sh.*, u.initials AS initals FROM database1.table1 AS sh
I am running this query on MySQL SELECT ID FROM ( SELECT ID, msisdn
I am running this query using CakePHP: $total = $this->Lapse->query(select sum(unix_timestamp(stop) - unix_timestamp(start)) from
SELECT * FROM [makes$] WHERE Corporate Name='Champion Enterprises, Inc.' I'm running this query on
I'm running this query on a MYSql database: select * from wp_postmeta where meta_key
I am running this query: SELECT u.id as id, COUNT(DISTINCT YEAR(TIMESTAMP), WEEK(TIMESTAMP)) cc, GROUP_CONCAT(DISTINCT

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.