Login
Register
Search
Home
Forums
Jobs
LawsonGuru
LawsonGuru Letter
LawsonGuru Blog
Worthwhile Reading
Infor Lawson News Feed
Store
Store FAQs
About
Forums
Performance Management
Smart Notification
SQL Date Syntax
Home
Forums
Jobs
LawsonGuru
LawsonGuru Letter
LawsonGuru Blog
Worthwhile Reading
Infor Lawson News Feed
Store
Store FAQs
About
Who's On?
Membership:
Latest:
Chris Radcliffe
Past 24 Hours:
0
Prev. 24 Hours:
0
Overall:
5187
People Online:
Visitors:
383
Members:
0
Total:
383
Online Now:
New Topics
S3 Customization/Development
Cobol - Extract Current Time
4/24/2024 7:21 PM
How do you extract just the Current System Time in
Lawson Landmark
LPL INSTR Functions
4/5/2024 8:32 PM
I'm writing a simple report using the Create R
Infor SCM
Translating 856 to get the ~ REF^CN^ field
4/3/2024 8:24 PM
We are trying to get the tracking number which is
IPA/ProcessFlow
Sample XML file create Flow
4/3/2024 3:43 PM
Hello everyone, I am new to creating XML files
Lawson S3 HR/Payroll/Benefits
bn105 error message
3/26/2024 6:40 PM
I need to change some of the set ups in our Life I
IPA/ProcessFlow
IPA executing Job
3/13/2024 7:08 PM
New to the IPA world and was wondering, can an IPA
Lawson S3 HR/Payroll/Benefits
Life Age Reduction on benefits plans
3/12/2024 7:15 PM
For our optional life we have an age based coverag
Lawson S3 HR/Payroll/Benefits
BN53.1 Add-In
3/7/2024 3:31 PM
We are migrating to Solstice. They require a
Lawson Business Intelligence/Reporting/Crystal
Domain Name Change
3/5/2024 7:45 PM
Our domain name needs to change and was hoping I c
S3 Customization/Development
Cobol calling Shell Script
2/29/2024 1:27 PM
Has anyone created or modified a Lawson Cobol prog
Top Forum Posters
Name
Points
Greg Moeller
4184
David Williams
3349
JonA
3288
Kat V
2984
Woozy
1973
Jimmy Chiu
1883
Kwane McNeal
1437
Ragu Raghavan
1351
Roger French
1311
mark.cook
1244
Forums
Unanswered
Active Topics
Most Liked
Most Replies
Search Forums
Search
Advanced Search
Topics
Posts
Prev
Next
Forums
Smart Notification
SQL Date Syntax
Sort:
Oldest First
Most Recent First
You are not authorized to post a reply.
Author
Messages
Ken Ptak
Basic Member
Posts: 20
11/14/2007 3:07 PM
Hello - I have a query that creates an Infoset using a JDBC connection successfully. I want to limit the records being returned by the Infoset where the PER_END_DATE is after July 1, 2007.
I receive the error “Error: ORA-01843: not a valid month”
When I try to add the following criteria to the SQL statement:
HAVING ((GMDISTRIB.PER_END_DATE)>'07/01/2007')
I’ve tried to play with the formatting of the date but I haven’t found the correct format…
Any suggestions/ideas?
Thanks,
Ken
Will
Veteran Member
Posts: 39
11/14/2007 3:23 PM
Hi Ken,
You need to cast those strings you are passing in the HAVING statement to something SQL can understand and use comparison (>) with.
HAVING (CAST(GMDISTRIB.PER_END_DATE AS datetime)>CAST('07/01/2007' AS datetime))
should work. Now you are comparing a date object with a date object.
Guillaume
Ken Ptak
Basic Member
Posts: 20
11/14/2007 4:12 PM
That makes sense, but it didn't quite work...
When I enered:
HAVING (CAST(GMDISTRIB.PER_END_DATE AS datetime)>CAST('07/01/2007' AS datetime))
I received the error:
Error: ORA-00902: invalid datatype
So I modified the query to read:
HAVING (CAST(GMDISTRIB.PER_END_DATE AS date)>CAST('07/01/2007' AS date))
Which removes the 'Invalid datatype' error message but I still get the original message:
Error: ORA-01843: not a valid month
Any other ideas? Thanks in advance!
Will
Veteran Member
Posts: 39
11/14/2007 5:17 PM
Oh, we are talking Oracle here, sorry I did not catch it.
What format is GMDISTRIB.PER_END_DATE in your table?
John Henley
Senior Member
Posts: 3348
11/14/2007 5:39 PM
Ken, since this is Oracle, you probably need to make sure you're entering the dates in the (default) format defined in the database, which is usually dd-MMM-ccyy (I think that is it--off the top of my head). Generally with Oracle, I avoid that altogether by using the to_date() function:
HAVING (GMDISTRIB.PER_END_DATE>to_date('2007-07-01','yyyy-mm-dd'))
Ken Ptak
Basic Member
Posts: 20
11/14/2007 6:24 PM
The to_date() function worked beautifully. Thanks for your help Guillaume and John!
You are not authorized to post a reply.