Help with Find

Hi All

I have a form with four(4) date fields among other types. When in the Find Mode I am able to successfully in three(3) of the date fields. The fourth date field always returns the error message “No result from search, modify last find?” I know that there is appropriate data in the field. It just seems that there is a problem with that specific feild as all the others work.

Feedback Appreciated

Tom

Hi,

Is there a different format setting on that field ?

You coud display the sql en pameters to see what goes wrong.

execute the following code after the search :

application.output('sql= ’ + databaseManager.getSQL(forms[_form].foundset))
application.output('parms= ’ + databaseManager.getSQLParameters(forms[_form].foundset))

Regards,

Hans

Hi Tom,

What exact column types are those fields in the backend database ?
Also what search criteria do you use that works/not work.

Thanks Hans

After more testing it only gets more interesting. It is not consistent. Sometimes it works and sometimes not. More not than does.
The formatting is as it should be. I even copied the date from a valid record and then pasted it in the find and still no results

Here is the results for the sql parameters

When working

sql= select reservation_id from reservations  where date_reserved = ? order by arrival_date asc, arrival_am asc, arrival_time desc
parms= [2008-01-04 00:00:00.0]

When not working

sql= select reservation_id from reservations  order by date_reserved desc, arrival_date asc, arrival_am asc, arrival_time desc
parms=

What exact column types are those fields in the backend database ?
Also what search criteria do you use that works/not work.

Robert

The column type is date/time and search criteria is exact match.

Thanks for all the help.

Tom

Hi,

Can you post a small sample that has the same issue ?

Regards,

Hans

Hi Hans,

This is the process Where the problem appears.
The problem field is “Date Reserved”.
[attachment=1]Picture 3.png[/attachment]

This is the results of the find.
[attachment=0]Picture 4.png[/attachment]

I know that a record exist with that date.

I tried replacing the field but that did not change or fix the problem.

Thanks Again.

Tom

Hi Tom,

If this is a datetime/timestamp column (in the backend database) then you also need to provide the time component.
Or are you using a formatting on the field?

Hi Robert

ROCLASI:
Hi Tom,

If this is a datetime/timestamp column (in the backend database) then you also need to provide the time component.
Or are you using a formatting on the field?

I am using formatting on the field (MM/dd/yyyy). Also, all of the other date fields(Arrival Date, Departure Date, etc.) are also formatted and they all work correctly. Weird Huh.

Tom

There is a flash tutorial on main site - Develop - Tutorials - 3.x Flash Tutorials that discusses how to find data.
http://www.servoy.com/generic.jsp?taxonomy_id=353

My guess is that you are not searching correctly - by specifying only day/month/year, you do not identify all “date” values for that day. So you could have many timestamps in that day that all look the same when that format is applied, but searching like that searches for an exact date/time, not a time range. For example try using # in front of it.

The dates that you can find were probably entered through a field having the same format (thus defaulting hour/minute/sec/… to 0) while the ones that you do not find are created using “new Date()” or other methods or copied from somewhere and they have a different value for hour/minute/sec/… .

Hi Andrei,

Thanks. This really helps. You were correct. The data for the “Date Reserved” field is created using ‘date_reserved = application.getTimeStamp()’, thus put something beside 0’s in the time portion. Wow. You learn something new each day.

Thanks for everyone’s input.

Tom