Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Data Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more

Reply
mhender
Frequent Visitor

Using Date Range in SQL Statement to ODBC Data Source

What SQL statement should I use to return data from table F4111 in a date range of current date to previous year? Creation date column ILCRDJ in table F4111 holds a date entry that is a text string (ie: "06/14/26").  I am using an ODBC server and trying to use SQL statement to return by parameter. Here is an attempt and the error message received.

 

SELECT *
FROM F4111
WHERE ILCRDJ >= {fn CURDATE()-365}

 

"ODBC: ERROR [HY000] [IBM][System i Access ODBC Driver][DB2 for i5/OS]SQL0182 - A date, time, or timestamp expression not valid."

0 REPLIES 0

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

June Fabric Update Carousel

Fabric Monthly Update - June 2026

Check out the June 2026 Fabric update to learn about new features.