Union of two queries using vb6.0 coding

Discussion in 'Visual Basic ( VB )' started by srbatcha, Mar 25, 2010.

  1. srbatcha

    srbatcha New Member

    Joined:
    Aug 31, 2009
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    0
    i have two query:

    #1. Year wise Report:

    rec.Open "select Sales_Person_ID,Employee_Name,sum(Total_value),division_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),division_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
     
  2. techgeek.in

    techgeek.in New Member

    Joined:
    Dec 20, 2009
    Messages:
    572
    Likes Received:
    19
    Trophy Points:
    0
    Occupation:
    EOC (exploitation of computers)..i m a Terminator.
    Location:
    Not an alien!! for sure
    Home Page:
    http://www.techgeek.in
    what do u mean by connect out here...cud u explain me more??
     
  3. CrownSolution

    CrownSolution New Member

    Joined:
    Jan 26, 2011
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    I have the same problem as this!.....can you help me out in joining two queries like this!

    Thnx
     
  4. virxen

    virxen Active Member

    Joined:
    Nov 24, 2009
    Messages:
    387
    Likes Received:
    90
    Trophy Points:
    28
    ...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?
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice