Union of two queries using vb6.0 coding

srbatcha's Avatar, Join Date: Sep 2009
Newbie Member
i have two query:

#1. Year wise Report:

rec.Open "select Sales_Person_ID,Employee_Name,sum(Total_value),div ision_name,segment_name from segment_trans where (segment_trans.date >= #" & (fdate.Text) & "# and segment_trans.date<= #" & (tdate.Text) & "# ) GROUP BY Sales_Person_ID ,Employee_Name,division_name,segment_name order by division_name,segment_name", con, adOpenKeyset, adLockOptimistic

#2. Month wise Report:

rec1.Open "select Sales_Person_ID,Employee_Name,sum(Total_value),div ision_name,segment_name from segment_trans where (segment_trans.date >= #" & (Text3.Text) & "# and segment_trans.date<= #" & (Text4.Text) & "# ) GROUP BY Sales_Person_ID ,Employee_Name,division_name,segment_name order by division_name,segment_name", con, adOpenKeyset, adLockOptimistic


How to connect this two Queries with in one Query?


please help me.


Thanks
sathik
srbatca_29@yahoo.com
techgeek.in's Avatar, Join Date: Dec 2009
Skilled contributor
what do u mean by connect out here...cud u explain me more??
CrownSolution's Avatar, Join Date: Jan 2011
Newbie Member
I have the same problem as this!.....can you help me out in joining two queries like this!

Thnx
virxen's Avatar, Join Date: Nov 2009
Pro contributor
...where (segment_trans.date >= #" & (fdate.Text) & "# and segment_trans.date<= #" & (tdate.Text) & "# and segment_trans.date >= #" & (Text3.Text) & "# and segment_trans.date<= #" & (Text4.Text) & "#).....

have you tried this?