Consulting

Results 1 to 2 of 2

Thread: Solved: SQL Problem...Again

  1. #1
    VBAX Contributor
    Joined
    Jan 2007
    Posts
    146
    Location

    Solved: SQL Problem...Again

    hey, i've been trying to get this sql to work but no matter what, it just wont listen to me 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?

    [vba] 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]"[/vba]
    Last edited by akn112; 09-20-2007 at 07:42 AM.

  2. #2
    VBAX Contributor
    Joined
    Jan 2007
    Posts
    146
    Location
    found problem. seems that * must be replaced by % for some reason

Posting Permissions

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