Solved

GetRows(), Part 2

Posted on 2013-11-23
2
338 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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

746 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now