Results 1 to 3 of 3
  1. #1
    tmcrouse is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Apr 2009
    Posts
    169

    Help with Iif statement

    I have a table that has decrease column, termed column and hsetop column. the layout looks as such

    decrease termed hsetop
    -125 124 -1
    -14 102 88
    -19 178 159

    etc etc.

    the first line is correct but the other two are not and I want to put in an if query on the termed column that says if the hsetop is >0 then copy whatever is in the decrease column over to the termed column so my SQL right now looks like this: (select statement right now will chng to update once I figure code)

    select decrease, termed, hsetop from decreaseaug10 where
    (((termed)=iif([hsetop]<0,"([decrease])")));

    my error just says data type mismatch in criteria expression

  2. #2
    tmcrouse is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Apr 2009
    Posts
    169

    I think I got it

    update termed=[decrease] where (([hsetop[).0);

  3. #3
    weekend00 is offline I may not be right
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    1,295
    You did get it. except you have some typos and you did not post the whole query.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. If Then Statement Help
    By Kapelluschsa in forum Programming
    Replies: 5
    Last Post: 08-11-2010, 09:24 AM
  2. IIf Statement
    By dref in forum Forms
    Replies: 2
    Last Post: 07-16-2010, 02:46 AM
  3. IIf Statement...HELP!
    By bdhFS in forum Queries
    Replies: 5
    Last Post: 05-19-2010, 07:55 AM
  4. IIF statement
    By james1982 in forum Access
    Replies: 1
    Last Post: 07-20-2009, 09:38 AM
  5. how to use IF then statement
    By ronnie4 in forum Access
    Replies: 1
    Last Post: 03-17-2009, 11:32 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums