• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Union Query

New Here ,
Jan 16, 2008 Jan 16, 2008

Copy link to clipboard

Copied

I am having troubles trying to figure out how to write a union query. Here is the portion of the query that is troubling me:
SELECT 0 AS Total_Weekly_Hours_Recorded, 0 AS Total_Time_Spent, SUM(Value) AS Total_Value, 0 AS Total_Num_Checks_Trans
FROM tblTransType

What this is currently doing is summing up the values of all of the transaction type in the tblTransType table. What I need it to do is pull the Transaction type from the tblcontractinfo_submenuTable and then use the value of that transaction type from the tblTransType table and sum the values of the transtypes that have been entered in the tblcontractinfo_submenutable

I have attached the entire coding as well. The coding is not complete as also I need to list everything by date, then the manager and finally by user. Right now I am just working on the calculation part.
TOPICS
Advanced techniques

Views

180

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 16, 2008 Jan 16, 2008

Copy link to clipboard

Copied

LATEST
you need a grouped by clause. in fact, you need more than one.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation