Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3940606
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T00:26:22+00:00 2026-05-20T00:26:22+00:00

I executed the following statement but it only updates the price rows of all

  • 0

I executed the following statement but it only updates the price rows of all except Assasin creed (blank value). Also, the prices in the other rows in my table which are not defined below ironically was cleared (blank value). It seems to be working normally if i update 2 products though. What could be wrong?

(line breaks for display-wrapping only)

"UPDATE Products SET Price = IIf(Product = 'Crysis Wars'," +
CrysisWarsInput.Text +
", IIf(Product = 'Far Cry 2'," + FarCry2Input.Text +
", IIf(Product = 'Day of Defeat Source'," + DODSourceInput.Text +
", IIf(Product = 'GTA 4'," + GTA4Input.Text +
", IIf(Product = 'Asassins Creed'," + AssassinsCreedInput.Text + ")))))";
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T00:26:22+00:00Added an answer on May 20, 2026 at 12:26 am

    Maybe because you mis-spelt “Assasins Creed”?
    Either set a WHERE clause, or add Price as the default value in the last IIF

    "UPDATE Products SET Price = " +
    "  IIf(Product = 'Crysis Wars',"          + CrysisWarsInput.Text +
    ", IIf(Product = 'Far Cry 2',"            + FarCry2Input.Text +
    ", IIf(Product = 'Day of Defeat Source'," + DODSourceInput.Text +
    ", IIf(Product = 'GTA 4',"                + GTA4Input.Text +
    ", IIf(Product = 'Assasins Creed',"       + AssassinsCreedInput.Text + ", Price)))))";
    
    • the other rows in my table which are not defined below

    That’s what a WHERE clause is for, to restrict which records to update.

    "UPDATE Products SET Price = " +
    "  IIf(Product = 'Crysis Wars',"          + CrysisWarsInput.Text +
    ", IIf(Product = 'Far Cry 2',"            + FarCry2Input.Text +
    ", IIf(Product = 'Day of Defeat Source'," + DODSourceInput.Text +
    ", IIf(Product = 'GTA 4',"                + GTA4Input.Text +
    ", "                                      + AssassinsCreedInput.Text + ")))) +
    " WHERE Product in ('Crysis Wars','Far Cry 2','Day of Defeat Source'," +
    "  'GTA 4','Assasins Creed')";
    

    You can also use a SWITCH statement instead of multiple IIFs.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

As a root mysql user, I executed the following: grant all on mydb.* to
If I execute the following statement: string.Compare(mun, mün, true, CultureInfo.InvariantCulture) The result is '-1',
I'm unable to execute the following prepared statement , PREPARE stmt FROM 'SELECT sb.id,sb.category,sb.make,sb.name,sb.pic,rs.slot
I have used the following statements to get the current time. print $query executed
Why am I getting a syntax error with the following line? statement = self.sql.execute(DESCRIBE
While trying to execute the following lines only the last two statements are displayed(Here
i executed the following c code on my ubuntu machine...i have read about fcntl()'s
I was playing around and executed the following .bat @echo off mkdir %~dp0 pause
Following code gets executed whenever I want to persist any entity. Things seems to
I have the following statement to find unambiguous names in my data (~1 Million

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.