Results 1 to 2 of 2
  1. #1
    4 Star Lounger
    Join Date
    Jun 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    527
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Help with SQL string (A2002)

    Hi All,
    I have a select SQL string I need some help with. It is a bit nested and I can't figure it out. Here it is....

    strPartDisposition = "select * from [parts_RMA] where [parts_RMA].[part_so_number] = '" & Forms![wo_update].Text504.Value & "'" _
    & "And [parts_RMA]![part_qty] > 0 AND [parts_RMA]![part_wo_id]= " & Forms![wo_update]![Text490] & " or [parts_RMA]![part_wo_id] = 0)"

    The problem is with the OR at the end. It needs to look to text490 for a value and also check the part_wo_id for 0.

    Thanks,
    Mark

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Help with SQL string (A2002)

    Not sure what you want, but do parentheses help?

    strPartDisposition = "select * from [parts_RMA] where [parts_RMA].[part_so_number] = '" & Forms![wo_update].Text504.Value & "'" _
    & "And [parts_RMA]![part_qty] > 0 AND ([parts_RMA]![part_wo_id]= " & Forms![wo_update]![Text490] & " or [parts_RMA]![part_wo_id] = 0)"

Posting Permissions

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