Hello:
Even though this is a long post, I think the problem I have is fairly straightforward... Any help you can provide will be greatly appreciated!
I have four tables that I would like to combine in a Crystal Report (using a command - or perhaps something else would work better??). I am using Crystal Reports v10 (and could upgrade to v11 if needed).
Two of tables contain the *packaging* date and specific serial numbers that were packaged on that date. (The reason there are two tables is that IT recently archived this data and started a new table.) The other two tables contain the *shipping* date and the specific serial numbers that were shipped on that date. (Again, the reason there are two tables with this same information is that IT also archived the old data.) There is no overlap between these tables. In other words, the old data was archived on a date and the new tables were filled with new data the next date.
I am trying to use a command to combine these four tables. ****The overall goal is I want to see is a list of serial numbers that have been packaged in Q1'12 that haven't been shipped yet. ****
I have been able to create two separate commands that combine the two packaging tables and a second command that combines the two shipping tables... I do not know how to combine both of these commands and only show the serial numbers that haven't been shipped yet... I tried to do this in Crystal, and the report stalled and never did produce the desired results...
Here is the command I made to "combine" the two *packaging* tables:
SELECT `packaging_trac_archive1`.`id`, `packaging_trac_archive1`.`BarCode`, `packaging_trac_archive1`.`UpdateDate`
FROM `manufacturing`.`packaging_trac_archive` `packaging_trac_archive1`
WHERE (`packaging_trac_archive1`.`UpdateDate`>={ts '2012-01-01 00:00:00'} AND `packaging_trac_archive1`.`UpdateDate`<{ts '2012-04-01 00:00:01'})
UNION ALL
SELECT `packaging_trac1`.`idpackagingtrac`, `packaging_trac1`.`SerialNo`, `packaging_trac1`.`DateTime`
FROM `manufacturing`.`packaging_trac` `packaging_trac1`
WHERE (`packaging_trac1`.`DateTime`>={ts '2012-01-01 00:00:00'} AND `packaging_trac1`.`DateTime`<{ts '2012-04-01 00:00:01'})
Here is the command to combine the two *shipping* tables:
SELECT `shipping_trac1`.`SerialNo`, `shipping_trac1`.`DateTime`
FROM `manufacturing`.`shipping_trac` `shipping_trac1`
WHERE (`shipping_trac1`.`DateTime`>={ts '2012-01-01 00:00:00'} AND `shipping_trac1`.`DateTime`<{ts '2012-12-12 00:00:00'})
UNION ALL
SELECT `shipping_trac_archive1`.`Barcode`, `shipping_trac_archive1`.`ShipDate`
FROM `manufacturing`.`shipping_trac_archive` `shipping_trac_archive1`
WHERE (`shipping_trac_archive1`.`ShipDate`>={ts '2012-01-01 00:00:00'} AND `shipping_trac_archive1`.`ShipDate`<{ts '2012-12-12 00:00:01'})
Does anyone have any advice on how to combine these 4 tables to only show the serial numbers that haven't shipped yet?
Even though this is a long post, I think the problem I have is fairly straightforward... Any help you can provide will be greatly appreciated!
I have four tables that I would like to combine in a Crystal Report (using a command - or perhaps something else would work better??). I am using Crystal Reports v10 (and could upgrade to v11 if needed).
Two of tables contain the *packaging* date and specific serial numbers that were packaged on that date. (The reason there are two tables is that IT recently archived this data and started a new table.) The other two tables contain the *shipping* date and the specific serial numbers that were shipped on that date. (Again, the reason there are two tables with this same information is that IT also archived the old data.) There is no overlap between these tables. In other words, the old data was archived on a date and the new tables were filled with new data the next date.
I am trying to use a command to combine these four tables. ****The overall goal is I want to see is a list of serial numbers that have been packaged in Q1'12 that haven't been shipped yet. ****
I have been able to create two separate commands that combine the two packaging tables and a second command that combines the two shipping tables... I do not know how to combine both of these commands and only show the serial numbers that haven't been shipped yet... I tried to do this in Crystal, and the report stalled and never did produce the desired results...
Here is the command I made to "combine" the two *packaging* tables:
SELECT `packaging_trac_archive1`.`id`, `packaging_trac_archive1`.`BarCode`, `packaging_trac_archive1`.`UpdateDate`
FROM `manufacturing`.`packaging_trac_archive` `packaging_trac_archive1`
WHERE (`packaging_trac_archive1`.`UpdateDate`>={ts '2012-01-01 00:00:00'} AND `packaging_trac_archive1`.`UpdateDate`<{ts '2012-04-01 00:00:01'})
UNION ALL
SELECT `packaging_trac1`.`idpackagingtrac`, `packaging_trac1`.`SerialNo`, `packaging_trac1`.`DateTime`
FROM `manufacturing`.`packaging_trac` `packaging_trac1`
WHERE (`packaging_trac1`.`DateTime`>={ts '2012-01-01 00:00:00'} AND `packaging_trac1`.`DateTime`<{ts '2012-04-01 00:00:01'})
Here is the command to combine the two *shipping* tables:
SELECT `shipping_trac1`.`SerialNo`, `shipping_trac1`.`DateTime`
FROM `manufacturing`.`shipping_trac` `shipping_trac1`
WHERE (`shipping_trac1`.`DateTime`>={ts '2012-01-01 00:00:00'} AND `shipping_trac1`.`DateTime`<{ts '2012-12-12 00:00:00'})
UNION ALL
SELECT `shipping_trac_archive1`.`Barcode`, `shipping_trac_archive1`.`ShipDate`
FROM `manufacturing`.`shipping_trac_archive` `shipping_trac_archive1`
WHERE (`shipping_trac_archive1`.`ShipDate`>={ts '2012-01-01 00:00:00'} AND `shipping_trac_archive1`.`ShipDate`<{ts '2012-12-12 00:00:01'})
Does anyone have any advice on how to combine these 4 tables to only show the serial numbers that haven't shipped yet?