ok having a bit of an issue with this method at present what I am finding is that some blank fields are populating on blank to the new value but in other instinces it remains blank, there is no pattern it tends to be quite random.
Now I have never seen this method used before
iif(isnull(HHreg.fieldname)," ",HHreg.fieldname) & " AS ExprNNN"
And what it actually does is adds the value AS ExprNNN to the current value I believe there is an error in it somewhere, as I ahve not seen this method use I am unable to figure it out.
Here is a copy of the code:
INSERT INTO Regestration ( parkcode, weedname, percentage, infestedarea, riskrating, vegetationtype, soil, monthtobetreated, Yeartobetreated, commonlocationname, drainageline, roadsideinfestation, [constraints], specialconsiderations, [life cycle], strata, Northings, Eastings, [Login name], [Login date] )
SELECT IIf(IsNull([HHreg].[parkcode]),0,[HHreg].[parkcode]) AS Expr2, IIf(IsNull([HHreg].[weedname]),"None Entered",[HHreg].[weedname]) AS Expr5, IIf(IsNull([HHreg].[percentage]),"0%",[HHreg].[percentage]) AS Expr6, IIf(IsNull([HHreg].[infestedarea]),0,[HHreg].[infestedarea]) AS Expr7, IIf(IsNull([HHreg].[riskrating]),"None Set",[HHreg].[riskrating]) AS Expr8, IIf(IsNull([HHreg].[vegetationtype]),"None Set",[HHreg].[vegetationtype]) AS Expr9, IIf(IsNull([HHreg].[soil]),"None Set",[HHreg].[soil]) AS Expr10, IIf(IsNull([HHreg].[monthtobetreated]),"January",[HHreg].[monthtobetreated]) AS Expr20, IIf(IsNull([HHreg].[Yeartobetreated]),"2002",[HHreg].[Yeartobetreated]) AS Expr11, IIf(IsNull([HHreg].[commonlocationname]),"Not Set",[HHreg].[commonlocationname]) AS Expr12, IIf(IsNull([HHreg].[drainageline]),0,[HHreg].[drainageline]) AS Expr13, IIf(IsNull([HHreg].[roadsideinfestation]),0,[HHreg].[roadsideinfestation]) AS Expr14, IIf(IsNull([HHreg].[constraints]),"None",[HHreg].[constraints]) AS Expr15, IIf(IsNull([HHreg].[specialconsiderations]),"None",[HHreg].[specialconsiderations]) AS Expr16, IIf(IsNull([HHreg].[lifecycle]),"None Set",[HHreg].[lifecycle]) AS Expr17, IIf(IsNull([HHreg].[strata]),"None Set",[HHreg].[strata]) AS Expr18, Left([Northings],6) AS Expr3, Left([Eastings],7) AS Expr4, "HandHeld" AS Expr1, IIf(IsNull([HHreg].[dateregistered]),"",[HHreg].[dateregistered]) AS Expr19
FROM HHreg;
thanks
![[afro] [afro] [afro]](/data/assets/smilies/afro.gif)
ZeroAnarchy
Experience is a wonderful thing. It enables you to recognize a mistake
when you make it again.