Results 1 to 2 of 2
  1. #1
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts
    to find in rset i use 2 diffrent sql qury string is possible to integrate in one... the table is the same.

    TROVA_AREA = .Fields!PROVA19
    TROVA_DISTRETTO = .Fields!PROVA20

    Set X = ListView.ListItems.Add(, , Left(.Fields!PROVA16, 4))

    SQL = "SELECT DESCR_COD_3 FROM STAFF WHERE COD_3='" & TROVA_AREA & "'"
    Set RSSQL = CNSQL1.Execute(SQL)

    X.SubItems(1) = Trim((RSSQL.Fields!DESCR_COD_3))

    SQL = "SELECT DESCR_COD_4 FROM STAFF WHERE COD_4='" & TROVA_DISTRETTO & "'"
    Set RSSQL = CNSQL1.Execute(SQL)

    X.SubItems(2) = Trim(RSSQL.Fields!DESCR_COD_4)

  2. #2
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,624
    Thanks
    3
    Thanked 60 Times in 60 Posts
    It should be possible to combine the two SQL strings into a single statement that looks something like:

    SQL = "SELECT DESCR_COD_3, DESCR_COD_4 FROM STAFF WHERE COD_3='" & TROVA_AREA & "' &" OR COD_4='" & TROVA_DISTRETTO & "'"
    Wendell

Posting Permissions

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