Skip to Content
author's profile photo Former Member
Former Member

expression must match error

I am building a search expression for one of my data window, below is the code i am using:

ls_dr_no = string(ld_dr_no)

ls_posting_date = string(ld_posting_date)

ll_rowfound = a_dw.find('dr_no="' + ls_dr_no + '" and audit_posting_date="' + ls_posting_date + '"',1,a_dw.rowcount())

a_dw has both columns dr_no and audit_posting_date in it. When I use the above expression I get an error message that expression types must match. If I try to build string with ld_dr_no(decimal datatype) and ld_posting_date (date datatype) the program won't even compile beause compiler tells me that I am building a string by concatenating date or decimal datatype to it. Is not possible to search thru the datawindow columns whose datatype is other then string? If it is how do I build my search string? Can someone please help. Thanks.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Mar 22, 2013 at 07:27 PM

    I was getting messages back from this site that your message has been approved by our moderator but I could not see my thread in content so I thought there was a problem with the website as there were issues encountered recently so I go a little impatient and posted this post in sybase newsgroups as well, sorry for the duplication but it is the same question.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Mar 25, 2013 at 09:27 AM

    Correct Syntax could be this:

    s_dr_no = string(ld_dr_no)

    ls_posting_date = string(ld_posting_date)

    ll_rowfound = a_dw.find('dr_no=' + ls_dr_no + ' and audit_posting_date="' + ls_posting_date + '"',1,a_dw.rowcount())

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Mar 22, 2013 at 08:26 PM

    Start by entering the expression in the DW Painter IDE. That's the easiest way to get the syntax right. Then convert that into your code.

    It needs to end up looking something like:

    find("dr_no = 'abc' and audit_posting_date = date('2013-03-22')")

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.