PDA

View Full Version : Solved: SQL Problem...Again



akn112
09-20-2007, 06:48 AM
hey, i've been trying to get this sql to work but no matter what, it just wont listen to me:dunno It worked fine before, but now i've added in the select case part of the code and its not filtering. Is my syntax wrong? :bug:

gstrListBoxRowSource = "SELECT ua.[UserAccessId] As [UA ID],
ua.[Last Name], ua.[First Name], r.[RequestName] As Request, p.Name AS [MP Name], s.[StatusName] As [Status]" _
& " FROM tblRequest AS r, tblUserAccess AS ua, tblParticipants AS p, tblStatus AS s" _
& " WHERE r.[requestId] = ua.[RequestId]" _
& " AND ua.[StatusId] = s.[StatusId]" _
& " AND ua.[StatusId] > 1" _
& " AND p.[MP ID] = ua.[MP ID]"
Select Case Me.OpenArgs
Case "SAR"
gstrListBoxRowSource = gstrListBoxRowSource & " AND tblUserAccess.[MERequest] not like 'Other-*'"
Case "OTHER"
gstrListBoxRowSource = gstrListBoxRowSource & " AND tblUserAccess.[MERequest] like 'Other-*'"
End Select
gstrListBoxRowSource = gstrListBoxRowSource & " ORDER BY s.[StatusId] DESC,ua.[UserAccessId]"

akn112
09-20-2007, 10:19 AM
found problem. seems that * must be replaced by % for some reason