Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2002
    Location
    By my computer, all day, every day! :)
    Posts
    22

    Question Unanswered: Microsoft Access validation check expression problem

    Hey all,

    I'm creating a database in Micrsoft Access to hold book records, so one of the fields I've got is 'Shelf Number' which is the 532.25 or whatever you get on the spine, and I'm trying to put in a validation check for the field so that it will accept "FIC" and any number under 1000 with any number of decimel places but I can't seem to get it to work. Currently I have;
    Like "FIC" Or "<1000"
    But it doesn't seem to matter what I do, I can't get it to accept all the values - either it will accept "FIC" or the numbers, not both.

    Has anyone got any ideas on how to make it work?

    Thanks,
    Essbee.
    :-)

  2. #2
    Join Date
    Apr 2002
    Posts
    5
    You should probably post this to the MS Access forum, not Oracle, but...

    This is likely due to comparing accross discrete data types. You will need to use the CAST function to explicitly convert to the same data type.

    If the shelf number is defined as a string type (VARCHAR) then try this:

    WHERE ShelfNumber = 'FIC' OR CAST(ShelfNumber AS INT) < 1000

    Sorry I don't know the native Access data types off-hand, so I used the Sql Server data types.


    Regards,
    Jason Woosley

  3. #3
    Join Date
    Apr 2002
    Location
    By my computer, all day, every day! :)
    Posts
    22
    Thanks.

    I know I posted it in the wrong place, but I didn't realsie until after I'd posted it... oops...

    Anyway, it works now. (yay!)
    Thanks again,

    Essbee.

  4. #4
    Join Date
    Apr 2001
    Location
    Netherlands
    Posts
    191
    Moved it to the right forum.
    Ruud Schilders
    -----------------
    Oracle DBA
    e-mail : ruud@schilders.it
    URL : www.schilders.it
    Twitter : www.twitter.com/ruudschilders

Posting Permissions

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