Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

What date format should I use for 'OrderDate' field in Sql quries?

Status
Not open for further replies.

sai1234ram

Programmer
Mar 16, 2008
9
IN
Dear Team
I am working with Sage MAS90 version 4.2.
I am retriving the datas from "SO_SalesOrderHeader" table.
Here I have given my query string
Sqlqry= "Select ItemCode,ItemCodeDesc,OrderDate,OrderType from SO_SalesOrderHeader where OrderDate='3/31/2008'". for that query I am getting the error as "ERROR [S0000] [ProvideX][ODBC Driver]Invalid operand for operator: ="
I think the Date format which I am giving is wrong.

Can anyone tell me which format is to be used.
Regards
Kaliprasanna
 
Write a Crystal report based on the table and with that selection and then go look at the SQL statement. That will tell you how to write it.
 
Your query doesn't make sense. ItemCode is not in the SO_SalesOrderHeader table.

Dawn
 
SQL uses the "yyyy-mm-dd" format. You should change it to:

WHERE SalesOrderDate <={d'2008-03-31'}.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top