Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8588971
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T22:55:55+00:00 2026-06-11T22:55:55+00:00

I have a table in which date column is stores as varchar. while doing

  • 0

I have a table in which date column is stores as varchar.
while doing the Object relational mapping (i am using eclipselink) i want to map this string/varchar to Date object in java.

My table is :

T_BUSINESS
  TRAN_ID        Number, 
  BUSINESS_DATE  Varchar

and I want to select all the rows where business date is between two input dates, here problem is since BUSINESS_DATE is varchar i cannot carry out the comparison. I can’t modify the table and i don’t wanna use the Native sql.

Can anybody tell me how can I do this.

Thanks in advance!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T22:55:56+00:00Added an answer on June 11, 2026 at 10:55 pm

    You can use a TypeConverter to map this,

    See,

    http://www.eclipse.org/eclipselink/documentation/2.4/jpa/extensions/a_typeconverter.htm#CHDHCCJF

    Doing comparisons in queries may be more difficult, I think the default date format is yyyy-mm-dd so a varchar comparison may work. Otherwise you really need a real DATE field on the database. You could use a database function to convert the varchar to a DATE for comparison, such as using CAST or FUNCTION which EclipseLink support is JPQL.

    See,
    http://www.eclipse.org/eclipselink/documentation/2.4/jpa/extensions/j_cast.htm#cast

    http://www.eclipse.org/eclipselink/documentation/2.4/jpa/extensions/j_func.htm#func

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an order table in MySQL database, having a field/column which stores the
I have premiere_poland column in database table which is date type. /** @Column(type=date, nullable=TRUE)
I have table which contains data along with created on date. I want to
I have a varchar(5) column in a table which contains the hour and minutes
I have a DATETIME column on my table which stores when a record was
I have a table which will have a date/time column to store create date
I have a table in SQL Server 2005 which has a date time field.
I have a table, tblClient , which stored a client's date of birth in
i have a table which has many fields but i want to get count
I have a table which i want to store all the outputs into one

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.