Home > database >  Questions about the subtotal amount of PB group data window!
Questions about the subtotal amount of PB group data window!

Time:09-21

I now have two tables:
A table to save every ticket bill of lading details, such as tdhao (b/l no.) this is also a primary key, chming (name), hci (voyage), d_port (destination port), line_name (routes), line_opter operation (), line_owner (line manager), wtdwei (customer name), wtdwei_owner (Sells) customers belong to, and so on,
Another table to hold every ticket the cost of the Marine bill of lading, tdhao (b/l date), fymcheng project (charges), f_shorf (is charge or pay project), the three primary key column combinations, (as a foreign key and tdhao, is also associated with the first table), fyjer (amount), and so on

I built a GROUP class data window, made from tdhao grouping, and then directly into the SQL editor are as follows:
My group 2 table data, extracting data window
The SELECT agentmsc_base tdhao,
Agentmsc_base chming,
Agentmsc_base hci,
Agentmsc_base d_port,
Agentmsc_base c20,
Agentmsc_base c40,
Agentmsc_base c40h,
Agentmsc_fyong fymcheng,
Agentmsc_fyong f_shorf,
Agentmsc_fyong fyjer,
Agentmsc_fyong. Fyjer_u
The FROM agentmsc_base,
Agentmsc_fyong
The WHERE (agentmsc_base. Tdhao=agentmsc_fyong. Tdhao)
And ((agentmsc_fyong dwmcheng like: s_dwmcheng) and
(agentmsc_fyong fymcheng like: s_fymcheng) AND
(agentmsc_fyong f_ok like: s_f_ok) AND
(agentmsc_base wdate & gt;=: dt_date1) AND
(agentmsc_base wdate & lt;=: dt_date2) AND
(agentmsc_base line_opter like: s_line_opter) AND
(agentmsc_base line_owner like: s_line_owner) AND
(agentmsc_base wtdwei like: s_wtdwei) AND
(agentmsc_base wtdwei_owner like: s_wtdwei_owner) AND
(agentmsc_base line_name like: s_line_name) AND
Agentmsc_base. F_stage & lt;> '0' AND
Agentmsc_base. F_stage & lt;> '1' and
Agentmsc_fyong. F_shorf='S' AND
AGENTMSC_BASE. ROLL_OVER & lt;> '1' AND
AGENTMSC_BASE. ROLL_OVER & lt;> '3')
The ORDER BY agentmsc_base chming ASC,
Agentmsc_base. Hci ASC,
Agentmsc_base. Tdhao ASC


I want to use the packet data window implementation according to certain conditions (such as line_name, wtdwei, line_owner, etc.) after the search, conform to the conditions of every ticket tdhao under corresponding fyjier (amount), fymcheng list (name), and subtotal, total
Below is I want effect: retrieve (conditions)

The bill of lading, name of vessel voyage name of destination port cost, amount
TT001 MSC11 010 QD, CHINA sea freight 1000
TT001 MSC11 010 QD, CHINA freight lu 200
TT001 MSC11 010 QD, CHINA change single fee 100
Subtotal: 1300
TT002 MSC11 010 QD, CHINA sea freight 1100
TT002 MSC11 010 QD, CHINA freight lu 200
TT002 MSC11 010 QD, CHINA change single fee 100
Subtotal: 1400
Total: 2700


If I put the WHERE to retrieve delete these conditions, you can retrieve the eligible for besides these conditions in other data:

(agentmsc_base wdate & gt;=: dt_date1) AND
(agentmsc_base wdate & lt;=: dt_date2) AND
(agentmsc_base line_opter like: s_line_opter) AND
(agentmsc_base line_owner like: s_line_owner) AND
(agentmsc_base wtdwei like: s_wtdwei) AND
(agentmsc_base wtdwei_owner like: s_wtdwei_owner) AND
(agentmsc_base line_name like: s_line_name) AND
But if these conditions are not to delete, can't retrieve data,
I tried to use the above SQL statement in the SQL query analyzer, you can retrieve the wanted data!

CodePudding user response:

Problems should be still in your SQL, you put the SQL in a grid data window, look to whether can retrieve the data?


If can't find the problem reason, also don't tangle, use filtering to implement
  • Related