MY SQL view Code:
SELECT TOP 3 Temp.RecordID AS RecordID, Temp.Cond AS Cond, Temp.FirstFourSeg AS FirstFourSeg, IIf([Forms]![frmSubject]![FirstFourSeg] Like '*bsm*',IIf([FirstFourSeg] Like '*bsm*',0,10000),0) AS AdjBSMSub, IIf([FirstFourSeg] Like '*bsm*',IIf([Forms]![frmSubject]![FirstFourSeg] Like '*bsm*',0,-10000),0) AS AdjBSMComp, IIf([Forms]![frmSubject]![Cond]=[“A”],IIf([Cond]=[“E”],-0.2*[SalePrice]
,IIf([Cond]=[“G”],-0.1*[SalePrice],IIf([Cond]=[“A”],0,IIf([Cond]=[“F”],
0.1*[SalePrice],IIf([Cond]=[“P”],0.2*[SalePrice],0)))))) AS AdjACond
FROM [Select Temp.Property, Temp.RecordID, Temp.Stat, Temp.InfoCmfStatus, Temp.SlDate, Temp.SalePrice, Temp.AltAcctNum, Temp.MapTaxLot, Temp.MaintArea, Temp.Nbhd, Temp.CoPropCls, Temp.InstNos, Temp.TotAcres, Temp.Acreage, Temp.HeatAc, Temp.OwnerName, Temp.MhSpace, Temp.Situs, Temp.SitusCSZ, Temp.Baths, Temp.Bedrooms, Temp.BldgCls, Temp.ActYear, Temp.EffYrBlt, Temp.Cond, Temp.Area, Temp.Plumbing, Temp.FirstLandType, Temp.SegType, Temp.Class, Temp.Make, Temp.Model, Temp.Width, Temp.Length, Temp.ImpType, Temp.ImpId, Temp.LandTypes, Temp.FirstFourSeg
FROM Temp WHERE Temp.RecordID = 1
Union
Select Temp.Property, Temp.RecordID, Temp.Stat, Temp.InfoCmfStatus, Temp.SlDate, Temp.SalePrice, Temp.AltAcctNum, Temp.MapTaxLot, Temp.MaintArea, Temp.Nbhd, Temp.CoPropCls, Temp.InstNos, Temp.TotAcres, Temp.Acreage, Temp.HeatAc, Temp.OwnerName, Temp.MhSpace, Temp.Situs, Temp.SitusCSZ, Temp.Baths, Temp.Bedrooms, Temp.BldgCls, Temp.ActYear, Temp.EffYrBlt, Temp.Cond, Temp.Area, Temp.Plumbing, Temp.FirstLandType, Temp.SegType, Temp.Class, Temp.Make, Temp.Model, Temp.Width, Temp.Length, Temp.ImpType, Temp.ImpId, Temp.LandTypes,Temp.FirstFourSeg
FROM Temp WHERE Temp.RecordID = 2 and Temp.Property not in (Select Temp.Property FROM Temp WHERE Temp.RecordID < 2)
Union
Select Temp.Property, Temp.RecordID, Temp.Stat, Temp.InfoCmfStatus, Temp.SlDate, Temp.SalePrice, Temp.AltAcctNum, Temp.MapTaxLot, Temp.MaintArea, Temp.Nbhd, Temp.CoPropCls, Temp.InstNos, Temp.TotAcres, Temp.Acreage, Temp.HeatAc, Temp.OwnerName, Temp.MhSpace, Temp.Situs, Temp.SitusCSZ, Temp.Baths, Temp.Bedrooms, Temp.BldgCls, Temp.ActYear, Temp.EffYrBlt, Temp.Cond, Temp.Area, Temp.Plumbing, Temp.FirstLandType, Temp.SegType, Temp.Class, Temp.Make, Temp.Model, Temp.Width, Temp.Length, Temp.ImpType, Temp.ImpId, Temp.LandTypes,Temp.FirstFourSeg
FROM Temp WHERE Temp.RecordID = 3 and Temp.Property not in (Select Temp.Property FROM Temp WHERE Temp.RecordID < 3)
Union
Select Temp.Property, Temp.RecordID, Temp.Stat, Temp.InfoCmfStatus, Temp.SlDate, Temp.SalePrice, Temp.AltAcctNum, Temp.MapTaxLot, Temp.MaintArea, Temp.Nbhd, Temp.CoPropCls, Temp.InstNos, Temp.TotAcres, Temp.Acreage, Temp.HeatAc, Temp.OwnerName, Temp.MhSpace, Temp.Situs, Temp.SitusCSZ, Temp.Baths, Temp.Bedrooms, Temp.BldgCls, Temp.ActYear, Temp.EffYrBlt, Temp.Cond, Temp.Area, Temp.Plumbing, Temp.FirstLandType, Temp.SegType, Temp.Class, Temp.Make, Temp.Model, Temp.Width, Temp.Length, Temp.ImpType, Temp.ImpId, Temp.LandTypes,Temp.FirstFourSeg
FROM Temp WHERE Temp.RecordID = 4 and Temp.Property not in (Select Temp.Property FROM Temp WHERE Temp.RecordID < 4)
Union
Select Temp.Property, Temp.RecordID, Temp.Stat, Temp.InfoCmfStatus, Temp.SlDate, Temp.SalePrice, Temp.AltAcctNum, Temp.MapTaxLot, Temp.MaintArea, Temp.Nbhd, Temp.CoPropCls, Temp.InstNos, Temp.TotAcres, Temp.Acreage, Temp.HeatAc, Temp.OwnerName, Temp.MhSpace, Temp.Situs, Temp.SitusCSZ, Temp.Baths, Temp.Bedrooms, Temp.BldgCls, Temp.ActYear, Temp.EffYrBlt, Temp.Cond, Temp.Area, Temp.Plumbing, Temp.FirstLandType, Temp.SegType, Temp.Class, Temp.Make, Temp.Model, Temp.Width, Temp.Length, Temp.ImpType, Temp.ImpId, Temp.LandTypes,Temp.FirstFourSeg
FROM Temp WHERE Temp.RecordID = 5 and Temp.Property not in (Select Temp.Property FROM Temp WHERE Temp.RecordID < 5)
Union
Select Temp.Property, Temp.RecordID, Temp.Stat, Temp.InfoCmfStatus, Temp.SlDate, Temp.SalePrice, Temp.AltAcctNum, Temp.MapTaxLot, Temp.MaintArea, Temp.Nbhd, Temp.CoPropCls, Temp.InstNos, Temp.TotAcres, Temp.Acreage, Temp.HeatAc, Temp.OwnerName, Temp.MhSpace, Temp.Situs, Temp.SitusCSZ, Temp.Baths, Temp.Bedrooms, Temp.BldgCls, Temp.ActYear, Temp.EffYrBlt, Temp.Cond, Temp.Area, Temp.Plumbing, Temp.FirstLandType, Temp.SegType, Temp.Class, Temp.Make, Temp.Model, Temp.Width, Temp.Length, Temp.ImpType, Temp.ImpId, Temp.LandTypes,Temp.FirstFourSeg
FROM Temp WHERE Temp.RecordID = 6 and Temp.Property not in (Select Temp.Property FROM Temp WHERE Temp.RecordID < 6)
Union
Select Temp.Property, Temp.RecordID, Temp.Stat, Temp.InfoCmfStatus, Temp.SlDate, Temp.SalePrice, Temp.AltAcctNum, Temp.MapTaxLot, Temp.MaintArea, Temp.Nbhd, Temp.CoPropCls, Temp.InstNos, Temp.TotAcres, Temp.Acreage, Temp.HeatAc, Temp.OwnerName, Temp.MhSpace, Temp.Situs, Temp.SitusCSZ, Temp.Baths, Temp.Bedrooms, Temp.BldgCls, Temp.ActYear, Temp.EffYrBlt, Temp.Cond, Temp.Area, Temp.Plumbing, Temp.FirstLandType, Temp.SegType, Temp.Class, Temp.Make, Temp.Model, Temp.Width, Temp.Length, Temp.ImpType, Temp.ImpId, Temp.LandTypes,Temp.FirstFourSeg
FROM Temp WHERE Temp.RecordID = 7 and Temp.Property not in (Select Temp.Property FROM Temp WHERE Temp.RecordID < 7)]. AS TOPTHREE
ORDER BY Temp.RecordID;
*****
For some reason Access puts [] brackets around my strings[A]
[E],[G],etc.