0

I am trying to do a data dump into Excel. One of my constraints isn't working so I am trying to fix it by looking at the SQL code. I have never used SQL and only know VBA. This is what I am trying. I need it to say V_ORDER_LINES.DATE_ITEM_PROM is less then one week from today.

SELECT V_ORDER_LINES.ORDER_NO, V_ORDER_LINES.SO_LINE, V_ORDER_LINES.DATE_ITEM_PROM, V_ORDER_LINES.DATE_SHIP, V_ORDER_LINES.PART, V_ORDER_LINES.QTY_ORDERED, V_ORDER_LINES.QTY_SHIPPED
FROM V_ORDER_LINES V_ORDER_LINES
WHERE (V_ORDER_LINES.DATE_ITEM_PROM<{day,7,CURDATE()})
4

1 回答 1

3

如果您正在查询 MySql,那么它可能看起来像

SELECT order_no, 
       so_line, 
       date_item_prom, 
       date_ship, 
       part, 
       qty_ordered, 
       qty_shipped
  FROM v_order_lines 
 WHERE date_item_prom < CURDATE() - INTERVAL 7 DAY
于 2013-07-25T00:21:34.803 回答