+ Reply to Thread
Results 1 to 5 of 5

writing excel VBA Query for fetching data from Access

  1. #1
    Forum Contributor vikas.bhandari's Avatar
    Join Date
    04-07-2006
    Location
    Delhi, India
    MS-Off Ver
    Office 2007 and 2010
    Posts
    303

    writing excel VBA Query for fetching data from Access

    Please dont remove this thread...its an excel question only...

    I am wrting the following query to get some data into excel from Access

    qur = "SELECT [Temp01.campaign] & [Temp01.AdGroup] & [Temp01.Keyword] AS Expr1 FROM temp01 where expr1 not in (SELECT [Campaigns.campaign] & [Campaigns.AdGroup] & [Campaigns.Keyword] as expr2 from campaigns where expr2<>expr1)"


    I am checking the combination of campaign, adGroup, and Keyword in two tables and finding the unique values and then entering them in the excel...

    The above query doesnt seem to be working....any help would be appreciated

    Vikas Bhandari

  2. #2
    Forum Expert
    Join Date
    11-23-2005
    Location
    Rome
    MS-Off Ver
    Ms Office 2016
    Posts
    1,628
    Try with this sql:

    HTML Code: 
    Regards,
    Antonio

  3. #3
    Forum Contributor vikas.bhandari's Avatar
    Join Date
    04-07-2006
    Location
    Delhi, India
    MS-Off Ver
    Office 2007 and 2010
    Posts
    303
    Dammnnnn....too good!!! I am really really impressed and believe me Antonio....

    You are the Best

    Vikas

  4. #4
    Forum Contributor vikas.bhandari's Avatar
    Join Date
    04-07-2006
    Location
    Delhi, India
    MS-Off Ver
    Office 2007 and 2010
    Posts
    303

    Unhappy Problem Again!!!!!!!!

    Hi,

    I have the following Table in my oracle database:

    Col1--------Col2--------Col3---------counter
    A-----------B-----------C------------1
    A-----------B-----------C------------2
    A-----------B-----------C------------3
    A-----------B-----------F------------4
    D-----------E-----------F------------5
    I------------J-----------K-------------6



    Now I need a query which will do the following things:

    1. Take all the unique combinations of the three columns from table and enter it in my excel. However, I need to take the unique row with the highest counter. For example, in above table, the first three rows are common, but I will take only the third row because it has the highest counter.

    Please please please help me!!! I am really getting crazy over this

    Thanks,
    Vikas

  5. #5
    Forum Expert
    Join Date
    11-23-2005
    Location
    Rome
    MS-Off Ver
    Ms Office 2016
    Posts
    1,628
    I'm sorry to answer so late to your question.

    If you have a table named 'TAB01' with the first three columns named 'C01', 'C02', 'C03', and the fourth named 'CTR' you can use this query:
    HTML Code: 
    Regards,
    Antonio

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1