
* columns from a AND JAN_Cum_qty_1_mo JAN_Cum_qty_2_mo JAN_Cum_all_val_mo JAN_Cum_air_val_mo JAN_Cum_air_wgt_mo JAN_Cum_ves_val_mo FEB_Cum_qty_1_mo FEB_Cum_qty_2_mo FEB_Cum_all_val_mo FEB_Cum_air_val_mo FEB_Cum_air_wgt_mo FEB_Cum_ves_val_mo. '12' (for Dec): Output table should be something like Output should have all columns from a and join columns from b when the months = '01' (for Jan), '02' (for FEB). ****** Script for SelectTopNRows command from SSMS ******/ I used left join but still I am loosing not all but few rows in a, I would also like to know how in one script I can columns separately from stat_mont =’01’ to stat_month =’12’
#Transtype 3.0.2 how to
I do not know how to have the multiple joins for 12 different months and what join I have to use.

I do not want to loose any row from a if there is no data for that row in b. I want to keep all the records in a, and join columns from b for each month. There is a column in b table called stat_month which ranges from 1 (Jan) to 12 (Dec). The columns will be added by month criteria. I have two tables a and b, where I want to add columns from b to a with a criteria. Joining Tables Through Multiple Criteria Oct 14, 2013
#Transtype 3.0.2 update


Wh.date_created, wh.task_descr, wh.actual_labour_sale+wh.actual_parts_sale as Select wh.worknumber, wh.custnum, wh.contract, wh.sitename, wh.itemcode, wh.regnum, m.name, di.weekchg, This is my basic code, but I keep ending up with duplicate work order lines in my result set. Additionally, there is the problem that the item can appear more than once in the deltickitem table against a particular contract (if item has been off-hired and then re-hired on the same contract number) - in this case the query must select the record with the highest di.counter number, which I haven't worked out how to put in my query. I need to include the field di.weekchg to show the weekly hire rate, but the joined query must ensure that the both the contract number matches that in the original select and that the item number matches that in the actual select. I want to add a field value from another table, deltickitem diwhich contains contract records.

I have a straight-forward select query to show work orders for a particular customer as below. Joining Tables With Multiple Criteria Jun 9, 2014
