Results 1 to 1 of 1
  1. #1
    KLynch0803 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jun 2009
    Posts
    37

    Complicated ASP SQL to Access db


    I need some help with a complicated SQL Query can someone help me write something like this?

    Im actually using this in an .asp webpage to access my db so if someone knows how to write this in asp sql it would be most handy for my application. TY in advance.

    Code:
    <%
     
    if DetectedButton = "Manually Match Requests" then
      'Prep the database to be accessed
      set conn=Server.CreateObject("ADODB.Connection")
      conn.Provider="Microsoft.Jet.OLEDB.4.0"
      conn.Open(Server.Mappath("/path to my.mdb"))
      set rs = Server.CreateObject("ADODB.recordset")
     
      SQL = 'Select * FROM tbl_Customers WHERE
      tbl_Customers.[MatchedTo] = NULL
     
      Then Find 3
     
      Select * FROM tbl_Service_Providers WHERE
      tbl_Service_Providers.[%CoverageArea%] = tbl_Customers.[zip] and
      tbl_Service_Providers.[%ServicesProvided%] = tbl_Customers.[ServiceType] and 
      tbl_Service_Providers.[LastMatchedDate] is oldest Date
     
      Then
     
      Insert 3 found tbl_Service_Providers.[ProviderID] and tbl_Service_Providers.[ServiceCompanyName] into tbl_Customers.[MatchedTo] seperated by "," between each of the three
     
    Update each of last three selected tbl_Service_Providers.[LastMtchedDate] to Now()
     
    End If
     
    %>
    Last edited by KLynch0803; 01-31-2010 at 08:35 PM. Reason: Correction to query needed

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 12-11-2008, 01:28 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums