Query To Create A New Field

C

carl

My database is like so:

record name type new field
1 sam current current-sam
2 bob future bob
3 tom future tom

I am trying to build a query that will create the new field above - if
"type" = "current" then current-"name" otherwise "name".

Thank you in advance.
 
D

Duane Hookom

Try something like

SELECT Record, [Name], [Type], IIf([Type]="Current", "Current-","") & [Name]
as NewField
FROM [My database is like so];
 
V

Van T. Dinh

I am not sure I undertand your question but you may want to watch out for
the possibility that you are storing calculated values???

The Relational Database Design Theory advises that calculated values are, in
general, should not be stored ...
 
Top