Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
intat
Starting Member
1 Post |
Posted - 2009-12-16 : 19:19:07
|
| I'm trying to join 2 columns together to make 1.Column 1 - PartCodeColumn 2 - DateCodeCreate a new Column 3 - HeatCodePartCode DateCode HeatCode12250 T169 T169-12250 10587 L139 L139-10587Can someone help?I'm using Access 2007 - Connected to a sql database. Trying to set this up using a query.. Current Actual sql CodeSELECT TOP 100 PERCENT dbo.tblLab_Chemistry.PlantID, dbo.tblLab_Chemistry.LineID, dbo.tblLab_Chemistry.SampleCode, dbo.tblLab_Chemistry.PartCode, dbo.vwPartCodeLookupTable.PartDescShort, dbo.tblLab_Chemistry.C, dbo.tblLab_Chemistry.Si, dbo.tblLab_Chemistry.Mn, dbo.tblLab_Chemistry.P, dbo.tblLab_Chemistry.S, dbo.tblLab_Chemistry.Mg, dbo.tblLab_Chemistry.Cr, dbo.tblLab_Chemistry.Cu, dbo.tblLab_Chemistry.Sn, dbo.tblLab_Chemistry.Ce, dbo.tblLab_Chemistry.Al, dbo.tblLab_Chemistry.Ti, dbo.tblLab_Chemistry.ProductionDate, dbo.vwPartCodeLookupTable.iron_chemistry, dbo.tblLab_Chemistry.UniqueID, dbo.GetDateCode2(dbo.tblLab_Chemistry.ProductionDate, dbo.tblLab_Chemistry.PlantID) AS DateCodeFROM dbo.tblLab_Chemistry LEFT OUTER JOIN dbo.vwPartCodeLookupTable ON dbo.tblLab_Chemistry.PartCode = dbo.vwPartCodeLookupTable.part_codeWHERE (dbo.tblLab_Chemistry.PlantID = 1 OR dbo.tblLab_Chemistry.PlantID = 2) AND (dbo.tblLab_Chemistry.LineID = 2 OR dbo.tblLab_Chemistry.LineID = 3)ORDER BY dbo.tblLab_Chemistry.UniqueID DESC |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2009-12-17 : 01:58:26
|
| If any one of the columns is of INT type you need to convert it into a varcharMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|
|
|