Thankyou, but ill have to explain a bit more.
Key:cart_order_id = Order ID
customer_id =Customer ID
time = Time at which order was subimitted
Basic Structure:CODE
TABLE: CubeCart_order_sum
##############################################
# cart_order_id # customer_id # time #
##############################################
# 123456 # 7 # 12654 #
# 982455 # 7 # 65498 #
# 982737 # 7 # 99999 #
# 369425 # 7 # 26437 #
# 126527 # 5 # 98774 #
# 963762 # 4 # 16642 #
##############################################
I want to return the most recent (highest time value) Order ID
Heres the breakdown of my original code:
SQL
"SELECT cart_order_id FROM CubeCart_order_sum WHERE time = (SELECT MAX(time) FROM CubeCart_order_sum) & customer_id = 7"
So what I want to return is:
QUOTE
# 982455 # 7 # 65498 #
# 982737 # 7 # 99999 #
# 369425 # 7 # 26437 #
# 126527 # 5 # 98774 #
982737Cheers
This post has been edited by Chalie9809: 3 Jul, 2009 - 11:14 PM