Date Syntax in a Where clause
Posted: Thu 20 Dec 2012 19:38
Hello!
I am developing a query which is filtering a Date field. I want to select only records which have a certain promise date.
Here is my query:
SELECT T1.order_id,T1.Lastname,T1.firstname,T1.b_city,T1.s_city,T1.s_state,T1.Total,T1.status,
T2.SchoolCode,T2.Entrydate,T2.ShipDate, T2.PromiseDate
FROM cscart_orders T1 LEFT JOIN HSD_OrderHeader AS T2
ON T1.order_id=T2.OrderNo
ORDER BY T1.order_id
WHERE T2.PromiseDate='11/05/2012';
When I run the query, I get a syntax error for the Where clause.
What am I missing?
Also, when it comes to entering the date, can I use a variable that comes from outside the Query? How would I do this?
Thanks in advance!
Tom Nesler
I am developing a query which is filtering a Date field. I want to select only records which have a certain promise date.
Here is my query:
SELECT T1.order_id,T1.Lastname,T1.firstname,T1.b_city,T1.s_city,T1.s_state,T1.Total,T1.status,
T2.SchoolCode,T2.Entrydate,T2.ShipDate, T2.PromiseDate
FROM cscart_orders T1 LEFT JOIN HSD_OrderHeader AS T2
ON T1.order_id=T2.OrderNo
ORDER BY T1.order_id
WHERE T2.PromiseDate='11/05/2012';
When I run the query, I get a syntax error for the Where clause.
What am I missing?
Also, when it comes to entering the date, can I use a variable that comes from outside the Query? How would I do this?
Thanks in advance!
Tom Nesler