Rabu, 28 Juni 2023

Re: [MSAccessProfessionals] Combine several update queries into one query

Jim,
 
Before I could answer that:
1) can we see that actual SQL for the queries
2) If you can give us a representative look at the data in the tables, that would help us greatly to determine if the queries can be engineered more succinctly/efficiently.
 
While in strict SQL terms it may be possible to combine operations, in SET Theory (mathematical) terms, it may or may not be "safe" to undertake such operations.
 
in short, we need some more information before we can reasonably answer you.
 
- Mark Burns
Owner, Professional Microsoft Access Developers Network [PMADN] Group, LinkedIn.com
 
On 06/28/2023 3:54 PM EDT Jim Wagner <josephwagner2@outlook.com> wrote:
 
 
Hello all,
I am looking at a very old process that creates a table daily. My retired boss created it a very long time ago, so I wanted to know if there is a way of making the process more efficient. I am breaking down the multiple queries in sections to see if i can recreate the process in less queries.
There are 3 update queries that update a table with values based on some criteria. there are 2 sources that are joined together to be the source. Below is the
The 3 queries update columns such as sick, vacation and comp with the balance for each. below are the query summary
sick column and Hrs taken Ytd for the YTDsick column based on the criteria of "Sick" for the Plan Type Descr field.
vac column and Hrs taken Ytd for the YTDsick column based on the criteria of "Vacation" for the Plan Type Descr field.
comp column and Hrs taken Ytd for the YTDsick column based on the criteria of "Comp time" for the Plan Type Descr field and "5W" for the Plan Type field.

Is there a way of getting this to be one query or I am I where I am at for good?

Thank You

Jim Wagner

Tidak ada komentar:

Posting Komentar