BusinessObjects Board

Adding a condition

Hi all,

I want to add a condition on a query using VBA. I’m just discovering SDK so my pb could seem easy : the ‘Work Date’ object is a date object and I want to make it equal to “2005/10/01” (for example). Here is the code :

ActiveDocument.DataProviders.Item(intReqIndex).Queries(1).Conditions.Add ClassCondition, "Work Date", "Equal to", strLine

where strLine is the string “2005/10/01”.
I’m workin on a DB2 database and the result is an SQL error cause of the date type of ‘work date’. So I’ve tried to change the code

ActiveDocument.DataProviders.Item(intReqIndex).Queries(1).Conditions.Add ClassCondition, "Work Date", "Equal to", strLine,boDateVariable

But it still doesn’t work, it adds to my query "Date Work equal to " Could someone help me?


Toby :fr: (BOB member since 2005-10-28)

I got my solution, I’ve to add quotes inside my string :

 ...  "'"+strLine+"'" ...

Excuse, next time i ll search better the forum before asking :wink:


Toby :fr: (BOB member since 2005-10-28)