Results 1 to 5 of 5
  1. #1
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts
    RSSQLD.Close
    SSQL = Empty
    SSQL = "SELECT PROVA19 FROM DATI WHERE PROVA16 = '" & TEST & "' AND NOT PROVA19 IS NULL"
    RSSQLD.Open SSQL, CNSQL, adOpenForwardOnly, adLockReadOnly

    Do
    RSSQLD.MoveFirst
    If Not RSSQLD.EOF Then
    Debug.Print Trim(RSSQLD!PROVA19)
    .AddItem Trim(RSSQLD!PROVA19) '& "-" & Trim(RSSQLD!PROVA20)
    End If
    RSSQLD.MoveNext

    Loop Until RSSQLD.EOF

    i use this sql to select distinct and not PROVA19 is not null...

    but in the loop the rset PROVA19 return few value blank???

    in effect i want to select distinct PROVA19 and not is blank...

  2. #2
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts
    Should the command be:
    SSQL = "SELECT PROVA19 FROM DATI WHERE PROVA16 = '" & TEST & "' AND PROVA19 IS NOT NULL"

  3. #3
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts
    [quote name='patt' post='764739' date='11-Mar-2009 02:23']Should the command be:
    SSQL = "SELECT PROVA19 FROM DATI WHERE PROVA16 = '" & TEST & "' AND PROVA19 IS NOT NULL"[/quote]

    Tks patt!
    But also the PROVA16 can be blank!
    How to

  4. #4
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts
    [quote name='sal21' post='764766' date='11-Mar-2009 18:22']Tks patt!
    But also the PROVA16 can be blank!
    How to[/quote]
    Do you want that as an additional condition or an alternative condition?
    For additional condirional you could try :
    SSQL = "SELECT PROVA19 FROM DATI WHERE PROVA16 = '" & TEST & "' AND PROVA19 IS NOT NULL AND PROVA16 is Null"

    If it's an alternative test try:
    SSQL = "SELECT PROVA19 FROM DATI WHERE (PROVA16 = '" & TEST & "' AND PROVA19 IS NOT NULL) OR PROVA16 is Null"

  5. #5
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts
    Also, I think you need to move "RSSQLD.MoveFirst" to before the "DO" statement.
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

Posting Permissions

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