Filter records in child command of heirarcheical commands in data environment.
Good day!
I need help with doing my data report. Its data source is a dataenvironment and I am using a heirarcheical commands. I have one command and it has one child command. Now I want to filter the records returned in the child command on runtime based on two range of dates. My table are Customers (idno, lastname,firstname) and orders (idno, product_no, price).
Re: Filter records in child command of heirarcheical commands in data environment.
Re: Filter records in child command of heirarcheical commands in data environment.
You may not need a child command. In the SQL section of the Command use a "join".
Code:
select * from orders inner join customers on orders.idno=customers.idno where datefield >= ? and datefield <= ?
Then at runtime
Code:
de1.Commands("Command1").Parameters("param1").value = somedate1
de1.Commands("Command1").Parameters("param2").value = somedate2
this is just an example, you will have to adjust it for your needs.