Click here to Skip to main content
15,902,866 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,
I have created an view In oracle which has a date Range in where claus.

SQL
Create view my_View as select a,b,c from XYZ,BYZ where XYZ.a=BYZ.b and XYZ.date_J between '1-apr-2011' and '21-may-2011'
(Dates are hardcoded)

I am using this view from c#. I dont want to use direct Query in c#.

I want to pass the date range from Windows Forms to View for the Report.

Can you help?

Thanx in advance! :)


Prathamesh
Posted
Updated 25-Sep-11 0:11am
v2

1 solution

Put a date column in your view and query the view like normal adding a where clause for your date.
 
Share this answer
 
Comments
prathameshpitale 25-Sep-11 6:02am    
Thanx.. But i have some used a very complex query. it has Group by Clauses.
Is there any other way?
Mehdi Gholam 25-Sep-11 6:10am    
It makes no difference you can insert a where clause anywhere in your query to filter the results.
prathameshpitale 25-Sep-11 9:05am    
Ok. Thank you.
prathameshpitale 26-Sep-11 4:10am    
Hi Mehdi Gholam.
I tried Your Suggestion. But I cannot Take Date column in My View as I am using Group Clause and Union ALl Clause in My Query.
Do you know any other way to use Substitution Variables for Date range in Query.

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