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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Duplicating Fields in Query Design View

Status
Not open for further replies.

i1055

MIS
Jul 6, 1999
11
US
If I have a formula in a field (w1:h1+g1), and i want to extend this formula out to other fields (w2:h2+g2)(w3:h3+g3), etc. etc....is there an easy way to do this???<br>
<br>
thanks
 
Have you ever tried the SQL view? The SQL is what the database engine actually understands - the Design view merely creates SQL from your input, and therefore sometimes creates the WRONG SQL, or SQL that takes ages to execute!<br>
<br>
Back to your question. I suggest using Copy, Paste in SQL.<br>
If eg. your statement says :<br>
SELECT h1+g1 AS W1, Surname, Firstname FROM tableName ...<br>
then copy paste the "h1+g1 AS W1," multiple times and then merely replace the number "1" with "2" etc. <br>
I can't think of any faster way.
 
I use Excel to produce long SQL strings. Use Excel fill/copy feature to create a columns of w1 etc. and all the other charcters needed in SQL string, including commas.<br>
<br>
Then use Concatenate function or formula like =A1&":"&B1 etc. to produce the string into one coloumn and copy/paste it to SQL view.<br>
<br>
Al
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top