Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create new table

Status
Not open for further replies.

lizray

Programmer
May 14, 2008
126
AU
I have no experience in this area so I appreciate any help/suggestions. I have a Table containing several fields, including VALUE,ID and TYPE. I want to create a new Table with fields VALUE and ID only, but if TYPE=D then ID should = ID+10000. What is the simplest way to do this ?
 
This can be done easily enough with a query.

In SQL view, it would look something like this:

Code:
SELECT IIf(tblA.Type='d',tblA.ID+1000,tblA.ID), 
tblA.Value
INTO NewTable
FROM tblA

 

You should note that two of your three fields names, Value and Type, are Reserved Words in Access and really need to be changed to something else. Not doing so almost assures that, sooner or later, the Access Gnomrs will jump up and bite where you sit!

The Missinglinq

Richmond, Virginia

There's ALWAYS more than one way to skin a cat!
 
Thanks Remou. you have made it look easy! and Misslnglinq for your very useful advice
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top