cancel
Showing results for 
Search instead for 
Did you mean: 

Search functionality

MG3
Contributor
0 Kudos

Hi

I have to perform a search in a table:

1. It has Date(java.sql.Date)

2. It has a description field with entry like: "Dual Objective Case to be discussed"

3. other fields.

My issues are:

1. When I try to search for a date, and enter the string "10/10/2005" in the search field and click Search button, even though there are entries, it cannot find it. Mainly because of differences in the date format. I understand java.sql.Date has the format yyyy-mm-dd. How do I resolve this problem?

2. When I give my search term as "Objective", i have to find the entry/entries in which the term "Objective" appears - irrespective of the position of the word in the description sentence. How can I achieve this?

Thanks

Manoj

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Manoj,

1. Try extracting the date,month and year from your string "10/10/2005" and use Date class constructor as

Date searchDate = new Date(int year,int month,int date)

2. Get each descriptions in a loop, use indexOf("Objective") function on the description, if the indexOf returns -1 , then it means this particular decription doesnt have Objective. Repeat this for all the descriptions. This is one possible way, but not an efficient one.

Regards,

Uma

Answers (0)