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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with date between in sql query 1

Status
Not open for further replies.

Glowworm27

Programmer
May 30, 2003
587
US
I am trying to query a table using a date range, and I am getting an error with this SQL

Can someone shed some light on this query" thanks

Code:
Select Count(*)  from Process_Status S
 Inner Join Process_Lookup L On S.Process_ID = L.Process_ID
 Where L.Process_Name = 'Get Labor Distribution'
 And S.Process_Status = 'Completed'
 And S.Process_Date Between '8-Jan-2005 2:41:38 PM' and '15-Jan-2005 2:41:38 PM';

SQL Plus returns an Error: ERROR at line 5:
ORA-01830: date format picture ends before converting entire input string

George Oakes
Check out this awsome .Net Resource!
 
You need to convert the date:
Code:
 And S.Process_Date 
           Between to_date('8-Jan-2005 2:41:38 PM','DD-Mon-YYYY HH:MI:SS PM')
               and to_date('15-Jan-2005 2:41:38 PM','DD-Mon-YYYY HH:MI:SS PM');



----------------------------------------------------------------------------
The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top