Click here to Skip to main content
15,037,662 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello all,

I'm trying to generate a query which will have a inner join between 2 tables, I was able to do that with oData Query generator tool , but was not able to include columns from second table in to the filter I'm putting it more clearly below in SQL terms.

SQL
Select a.Col1, a.col2, b.col1, b.col2
from a inner join b 
on a.id = b.id
where a.id = @id and b.startdate = @startdate

How can I add @startdate parameter also in to the oData query.

Please help.

Thank you.
Posted
Updated 21-Oct-12 11:24am
v2

1 solution

Query seems correct , Please convert parameter @startdate to appropriate date format like that Convert(DateTime,@startdate,Number).

or Try with this

SQL
Select a.Col1, a.col2, b.col1, b.col2
from a inner join b
on a.id = b.id
where a.id = @id and Convert(DateTime,b.startdate,103)= Convert(DateTime,@startdate,103)



Thanks,
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900