Database Reference
In-Depth Information
Figure 6-11. Using SQL expressions in the Query Designer
Renaming columns is about the simplest transformation you can do. This transformation is accomplished by
adding the alias to the Alias column in the Query Designer (Figure 6-11 ).
As we have seen previously, you change data types with either the CAST() or CONVERT() function, and both of
these can be typed right into the query window to form another SQL expression.
There is no reason why you cannot combine both the concatenation and added casting transformations as
shown in Figure 6-12 . Unfortunately, the Query Designer tool is not designed for this and will misunderstand
what you are trying to do even though you are using perfectly legal SQL syntax. As you click away from the
Column cell where your expression is typed, you will receive an error message stating that the conversion may be
unnecessary (Figure 6-12 ). You can ignore this error message as long as you are sure that the SQL syntax is correct
and appropriate to what you are trying to accomplish, but at least it will change your code, in spite of having to
work around this error message.
 
Search WWH ::




Custom Search