Results 1 to 6 of 6

Thread: SQL question

  1. #1

    Thread Starter
    Hyperactive Member Filter300's Avatar
    Join Date
    Aug 2001
    Posts
    413

    SQL question

    Can some one tell me what is wrong with this SQL statement?
    it wont update the field.....

    update PM017M01 Set BXAEDT = 1011213 where Prevcustnum = 'LUTS-4L3QRW-001' & BXB6CD = '02' & BXDANB = 1 & BXAEDT = 1010601

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333
    1. From where are you passing the statement, i.e., VB or directly from a query generator in your database?
    2. Does it generate an error, or does simply not do anything?

  3. #3

    Thread Starter
    Hyperactive Member Filter300's Avatar
    Join Date
    Aug 2001
    Posts
    413
    i'm using this in vb... but it wont work in access either.. it dosent get an error... it just says about to update 0 rows.... like its not getting a match in the db... but the 4 fields i have picked to match on are there and they match... so i dont know what is wrong...

  4. #4

    Thread Starter
    Hyperactive Member Filter300's Avatar
    Join Date
    Aug 2001
    Posts
    413
    it has somthing to do with the fact that i'm specifiying multiple where fields.. if i take all but one out it works fine.. anyone know how to do this with all 4 of my fields????

  5. #5
    Fanatic Member Gary.Lowe's Avatar
    Join Date
    May 2000
    Location
    In my sphere of influence
    Posts
    621
    Try

    pdate PM017M01 Set BXAEDT = 1011213 where Prevcustnum = 'LUTS-4L3QRW-001' AND BXB6CD = '02' AND BXDANB = 1 AND BXAEDT = 1010601
    Gary Lowe
    VB6 (Enterprise) SP5
    ADO 2.6
    SQL Server 7 SP3

    OK I know my spelling and grammer is crap so don't quote me on it!

    To err is human to take the P! is only natural !!

    Click on the top section of image for Marcus Miller website and bottom section of image for 'Run For Cover' sound clip


  6. #6

    Thread Starter
    Hyperactive Member Filter300's Avatar
    Join Date
    Aug 2001
    Posts
    413
    well i just messed with access and figured it out... if anyone cares this is what it should be....


    update PM017M01 Set BXAEDT = 1011213 where(Prevcustnum = 'LUTS-4L3QRW-001' and BXB6CD = '02' and BXDANB = 1 and BXAEDT = 1010601)

Posting Permissions

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



Click Here to Expand Forum to Full Width