Query To Create A New Field

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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.
 
Try something like

SELECT Record, [Name], [Type], IIf([Type]="Current", "Current-","") & [Name]
as NewField
FROM [My database is like so];
 
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 ...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top