on 03-22-2013 7:01 PM
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.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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())
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks to everyone for their contribution, all good suggestions. However becasue of some mixup some of the really helpful answers to this question are not there anymore but answers by for exmaple answers by Bruce and Jerry Siegel are not here anymore but they pointed out a very important factor about using format for date column.
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')")
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
98 | |
11 | |
11 | |
10 | |
10 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.