Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: PowerBuilder
Expertise: Beginner
Apr 7, 1999

Find() function matching date values

Question:
I am trying to use the find function using three char expressions and one date expression. I am using PB 6.5 with Oracle as the database. The following is my command string:

ll_RuleRow = dw_rule_modifiers.Find("modifier_code  = '" + ls_modifier +"'"+ &
 "AND state_abbr = '" + ls_state +"'"+ &
 " AND coverage_type = '" + ls_cov +"'"+ &
 " AND String(effective_date) = " + &
 " String(To_Date( '" + ls_Effective_Date + "',   'MM/DD/YYYY HH24:MI:SS'))", +&
 1, dw_rule_modifiers.RowCount())
I am having trouble getting the effective_date to work with the function. If I take the lines for the effective_date out, the function works. However, I need the effective_date to be in the function.

Answer:
The problem you are having is that you are using an Oracle function in your Powerscript. You need to use only PowerScript functions in the find command. Replace the Data portion of the code like:


" AND String( effective_date, 'YYYY/MM/DD' ) = '" + String( ld_Effective_date, 'YYYY/MM/DD' )  + "'"
This should now work.
DevX Pro
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date