Solved

GetRows(), Part 2

Posted on 2013-11-23
2
342 Views
Last Modified: 2013-11-23
Is there a way to use GetRows() on this...I am concerned with filtering out the records that are blank but not null:

    i = 0
    ReDim AsgndBibs(0)
    Set rs = New ADODB.Recordset
    sql = "SELECT pr.Bib FROM PartRace pr INNER JOIN RaceData rd ON pr.RaceID = rd.RaceID WHERE rd.EventID = "
    sql = sql & lEventID & " AND pr.Bib IS NOT NULL ORDER BY pr.Bib"
    rs.Open sql, conn, 1, 2
    Do While Not rs.EOF
        If Not rs(0).Value & "" = "" Then
            AsgndBibs(i) = rs(0).Value
            i = i + 1
            ReDim Preserve AsgndBibs(i)
        End If
        rs.MoveNext
    Loop
    rs.Close
    Set rs = Nothing

Open in new window

0
Comment
Question by:Bob Schneider
2 Comments
 
LVL 52

Accepted Solution

by:
Carl Tawn earned 500 total points
ID: 39671347
You'd be better to adapt your SQL query to filter out the blanks first, rather than pulling the results and filtering afterwards.

Change you where clause to:
sql = sql & lEventID & " AND (pr.Bib IS NOT NULL AND RTRIM(pr.Bib) = '') ORDER BY pr.Bib"

Open in new window

Then you can simply call GetRows() on the resulting recordset.
0
 

Author Closing Comment

by:Bob Schneider
ID: 39671352
Thanks!
0

Featured Post

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
How to leverage one TLS certificate to encrypt Microsoft SQL traffic and Remote Desktop Services, versus creating multiple tickets for the same server.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question