Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

dw_1.Find problem

Status
Not open for further replies.

siraj777

Programmer
Aug 22, 2002
27
IN
Problem with find.

Long ll_found
String ls_findexp, as_date, as_time

ls_date = '09/17/2003 15:06:00'
ls_time = '12:00:00'

Scenario 1:
ls_findexp = &quot;DateTime(crit_date,Time(&quot;+as_time+&quot;)) <= DateTime ('&quot; + as_date + &quot;')&quot;

ll_found = ids_critdt.Find(ls_findexp,1,ids_critdt.RowCount())

Scenario 2:

ls_findexp = &quot;DateTime(crit_date,Time(as_time)) <= DateTime ('&quot; + as_date + &quot;')&quot;
ll_found = ids_critdt.Find(ls_findexp,1,ids_critdt.RowCount())

Scenario 3:

ls_findexp = &quot;crit_date <= DateTime ('&quot; + as_date + &quot;')&quot;
ll_found = ids_critdt.Find(ls_findexp,1,ids_critdt.RowCount())


crit_date is the column in the table with date data type. (No time available in the table - populating dynamically).

Need to compare the datetime value with datatime value.
In 1, 2 the scenarious ll_found returning -5 (problem with expression). Scenario 3 works fine.

Any help would be appreciated
 
Try to add single quote on as_time for scenarios 1 and 2 just like what you did in as_date eg. '&quot;+as_time+&quot;'
and also check if the passed argument as_time is in a valid time format.
Hope this helps.
have fun!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top