Hence both the numbers 9877 and 456 are treated as text. The reason is the columns and are defined as datatype ‘Text’. You might think why it is not adding the two numbers when you use the “+” operator. On using both the operators, you get the same output 9877456. You’ll also observe that in the first row (or record), there are only numbers in both the columns. This answers the point 2 of the scenario. If you make use of “+” operator, then you’ll get a Null output. This answers the point 1 of the scenario. If you use “&” operator, then it will simply join the two strings and give you the output – “Daniel”. When both the values and are text, then you get the same output whether you use “&” operator or “+” operator. Now, on running the query, you’ll get the following output: Note, how I have created a query using both & operator and + operator in the screenshot above. Then include the two columns and in the query grid as shown in the screenshot below: Now, lets create a query using a ‘Query design’ and select the table ‘Customers’ on which you are going to run the query. When both the strings are other than NULL, it will give the same output as ‘&’ operator. The presence of NULL value, will give NULL as an output. “+” Operator: + Operator is different from & operator while only dealing with NULL Values.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |