VB to query the database, the connection is no problem, here is my query, has said have grammar question, please give advice or comments!
Select the customer name, customer ID, iif (registered capital & gt;=800, '5', the iif (registered capital & lt; 800 and registered capital & gt;=600, '4', the iif (registered capital & lt; 600 and registered capital & gt;=400, '3', the iif (registered capital & lt; 400 and registered capital & gt;=200, '2', '1')))) as the registered capital of score Basic information from customers
CodePudding user response:
Select the customer name, customer ID, iif (customer basic information. The registered capital & gt;=800, '5', the iif (customer basic information. The registered capital & lt; 800 and customer basic information. The registered capital & gt;=600, '4', the iif (customer basic information. The registered capital & lt; 600 and customer basic information. The registered capital & gt;=400, '3', the iif (customer basic information. The registered capital & lt; 400 and customer basic information. The registered capital & gt;=200, '2', '1')))) AS the registered capital of score from customer basic information"
CodePudding user response:
1. You are a pile of IIF () function that returns the result is a "value", not "field name"!!!! 2. SQL directly support the IIF () function? (in my impression, it seems no?) If you don't support, you need to be in "outside" SQL query, using VB statement prior to deal with the "result", then joining together into a SQL statement,
CodePudding user response:
SQL statement used in case when then
Refer to https://www.cnblogs.com/HDK2016/p/8134802.html
CodePudding user response:
Just checked the, select statement, directly with the if () function, not the iif (), Usage with VB6 iif (), only the function name is little one I,
(this paragraph is in around, nay reply, located in the "3 f", but unfortunately the network problems, do not reply... Then I went to do other things)