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!

Date /time problem

Status
Not open for further replies.

vbajock

Programmer
Jun 8, 2001
1,921
US
This is driving me nuts. I have to retrieve records by date range from a SQL Server database that is someone's legacy data off load. The dates are stored as text fields. I'm having trouble with the Wher clause. What syntax would I use to do this simple retrieval?


Where [Customer_Po] = '1000' and [co#] = '1' and [Invoice_Date] >= '01/01/1996' and [Invoice_Date] <= '12/31/1996'"

The above returns erratic data, probably because 1/1/2000 is less than 12/31/1996 when computing strings.

Thanks in advance for your help!

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top