Results 1 to 3 of 3
  1. #1
    New Lounger
    Join Date
    Jun 2002
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Update query with user defined function (97)

    I've written a user defined function to do some significance testing on 4 values (double) and return one value (integer). The function works just fine in a select query, but when I try to do an update query, it gets a type conversion error on the second row. If I remove that row, it gets the same error on the "new" second row. All the other rows are updated correctly. I've checked and rechecked the data types. But the twist is that I have access to a pc with Access 2000 - and it runs just fine there without converting ??? Since I need to work mainly on the "old" desktop, I'd like to get it running there. Thoughts?

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Update query with user defined function (97)

    Sorry but it isn't clear what you're trying to do with an update query. do you mean you're having a problem when you try to use your function in an update query? Is the field you're updating an integer field? And is the function actually returning an integer type or a variant?
    Charlotte

  3. #3
    New Lounger
    Join Date
    Jun 2002
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Update query with user defined function (97)

    Sorry I wasn't clear - the problem does occur only when I try to use the function in an update query (the error doesn't occur in a select query). But it only happens with one row of the 2000+ row table. The function is defined as an integer and is assigned return values of -1, 0 or 1. The field being updated is an integer field. The values passed to the function are double - but it doesn't seem to make any difference if I declare them in the function. What doesn't make sense it that it works for all but one row. And if I remove that row, it again works for all but one row - just a different row.

Posting Permissions

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