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!

Combine....

Status
Not open for further replies.
Aug 17, 2000
23
US
Hello,

Can anybody help me combine the following into one
SQL statement:

UPDATE qryDepts RIGHT JOIN qryTraining ON qryDepts.TrainingID = qryTraining.TrainingID SET qryTraining.[Select] = Yes
WHERE (((qryDepts.Department) Is Not Null));

And....

SELECT qryTraining.[Select], qryTraining.DocumentNo, qryTraining.Name
FROM qryDepts RIGHT JOIN qryTraining ON qryDepts.TrainingID = qryTraining.TrainingID;

...I'm trying to automate a manual process.

Any ideas, or help would be appreciated.

Thanks

GodofSmallThings




 
Hi,

In one query - you are changing fields in a table.
The other query selects and SHOWS data from a table.

You can't 'combine' these.

It's like saying:

x = 1 + 1

and

y = y - 1

How can you 'combine' 1st and 2nd statement?

If these 2 queries ALWAYS run one after the other, and you want to automate that - then ok.
In an <event> - use the RunSQL command, after saving the above queries to say MyUpdate and MySelect.

e.g RunSQL &quot;MyUpdate&quot;
RunSQL &quot;MySelect&quot;

Regards,

Darrylle



&quot;Never argue with an idiot, he'll bring you down to his level - then beat you with experience.&quot; darrylles@totalise.co.uk
 
Darrylle,

Thanks for your help. It works, but the whole process
is cumbersome. I need a more efficient way of marking
selected records, displaying those marked records with
the total records, and then removing the marks.

...I'm developing a training database.

It contains 3 tables. Departments, Training, and Required.
The Required table joins Departments and Training. In
the Training; I have a dummy field - a yes/no selector.

...I use that field to mark the different
trainings.

That's where I'm utilitizing the update queries.

If that makes sense to you, and you know of a smarter
way of implementing it please throw it my way!!!

Thanks for your assistance....

GodofSmallThings
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top