Adding fields to table like LTP1.......LTPn after query execution

  • Thread starter ppc via AccessMonster.com
  • Start date
P

ppc via AccessMonster.com

Hi
The query
UPDATE smallcapm INNER JOIN ppcsmlcap ON smallcapm.ScripCode = ppcsmlcap.
ScripCode SET smallcapm.LTP7 = [ppcsmlcap].[ltp];

I am having a table smallcapm with fields LTP1,LTP2,LTP3........LTP30.By
using above update query i am updating LTP1,LTP2,LTP3....... field of the
table smallcapm from table ppcsmlcap having new value of LTP each time.

Following is my requirement :

1. Instead of modifying the above query before running it as per the field
like LTP1,LTP2,LTP3.... i want the query to go to the next field ie. from
LTP1 to LTP2 to LTP3 etc by successive execution of the query.

2.Even better : is it possible to add the field LTPn+1 to the table smallcapm
each time the above query is run.

regds

prasanna
 
D

Duane Hookom

Why do this? Normally you should be adding records, not fields. You can use a
crosstab query to generate a view similar to your desired table structure.
 
P

ppc via AccessMonster.com

Hi Duane
Bcuz i want to store the records under the fields LTP1,LTP2,LTP3.... each
time i run the query.Moreover i dont want to modify the query each time to
change the field name from LTP1,LTP2,LTP3....

regds,

prasanna

Duane said:
Why do this? Normally you should be adding records, not fields. You can use a
crosstab query to generate a view similar to your desired table structure.
Hi
The query
[quoted text clipped - 17 lines]
 
D

Duane Hookom

IMHO, I just wouldn't do this without more justification. I would add records
to a normalized table. When/if I wanted to view a spreadsheet type
presentation, I would use a crosstab query.

--
Duane Hookom
Microsoft Access MVP
If I have helped you, please help me by donating to UCP
http://www.access.hookom.net/UCP/Default.htm


ppc via AccessMonster.com said:
Hi Duane
Bcuz i want to store the records under the fields LTP1,LTP2,LTP3.... each
time i run the query.Moreover i dont want to modify the query each time to
change the field name from LTP1,LTP2,LTP3....

regds,

prasanna

Duane said:
Why do this? Normally you should be adding records, not fields. You can use a
crosstab query to generate a view similar to your desired table structure.
Hi
The query
[quoted text clipped - 17 lines]
 

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

Top