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

Count Two Tables

Status
Not open for further replies.

KOVMoe

Programmer
Jun 30, 2004
34
US
I need to count two tables and put the information into a third table. Table one contains part shipments(all sorted and scanned). Table tw contains the same information, but has been filtered for duplicates. Table a might have 2355 lines and 150 duplicate scans. Table two would then have 2205 lines. The third then contains the count of the first and second tables, plus the date the counts were made.

I use this code to add the count to the third table, insert INTO D0606_PTEAUDIT.DBO.TSPHONE (PSI_CNT_HLD_INT, psi_cnt_fil_int)
SELECT COUNT(*)AS PSI_CNT_HLD_INT, (select count(*) from tsphfil)as psi_cnt_fil_int
FROM TSPHHLD
where shp_dt = (08/28/2006).

I get the first number, but never the second. ANy ideas?

Thanx

Thank you,

[king]Moe-King of the Village Idiots.

"When in trouble,
when in doubt;
Run in circles-
SCREAM & SHOUT!!"
Burma Shave
 
Not very clear with the question. Table2 is the lines for the Shipment Header. Is there any relationship between these 2 tables.
 
Yes, the only diff between the two tables is that the first has raw data, the second has had any duplicates removed. The tables themselves are exact duplicates.

Thank you,

[king]Moe-King of the Village Idiots.

"When in trouble,
when in doubt;
Run in circles-
SCREAM & SHOUT!!"
Burma Shave
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top