Hello!
I’m working on a VB.NET page that interfaces with an Access Database. I usually try to create my queries in Access first, then copy the SQL to my .aspx page. One particular query looks at the name in a column and outputs initials. Here is the SQL statement (which works perfectly in Access):
strSQL = “SELECT ID, ProjName, BidDate, ProjLoc, Engineer, EngCont, Owner, OwnerCont, IIf(ProjEst Like ‘Will*’,’W.T.’,IIf(ProjEst ” & _
“Like ‘Bob*’,’B.G.’,IIf(ProjEst Like ‘Doug*’,’D.M.’,IIf(ProjEst Like ‘Brian*’,’B.C.’,IIf(ProjEst ” & _
“Like ‘Mitch*’,’M.B.’,IIf(ProjEst Like ‘Cyle*’,’C.B.’,”)))))) AS ProEst, IIf(ExcEst ” & _
“Like ‘Kody*’,’K.S.’,IIf(ExcEst Like ‘Mike*’,’M.M.’,IIf(ExcEst Like ‘Doug*’,’D.M.’,IIf(ExcEst ” & _
“Like ‘Ron*’,’R.M.’,”)))) AS ExEst, IIf(UtilEst Like ‘Norm*’,’N.D.’,IIf(UtilEst ” & _
“Like ‘Kevin*’,’K.B.’,IIf(UtilEst Like ‘Trav*’,’T.F.’,”))) AS UtiEst, IIf(ConcEst ” & _
“Like ‘Will*’,’W.T.’,IIf(ConcEst Like ‘Bob*’,’B.G.’,IIf(ConcEst Like ‘Doug*’,’D.M.’,IIf(ConcEst ” & _
“Like ‘Brian*’,’B.C.’,IIf(ConcEst Like ‘Mitch*’,’M.B.’,”))))) AS ConEst, TurnTot, ” & _
“ExcTot, UtilTot, ConcTot FROM tblAllBids ” & _
“WHERE ((BidDate>=#10/27/2005#) AND (ProjStat Is Null) AND ” & _
“(ExcStat Is Null) AND (UtilStat Is Null) AND (ConcStat Is Null)) ORDER BY ID;”
All the columns reproduce fine on the Web page, with the exception of ProEst, ExEst, UtiEst & ConEst, which are all empty. I’ve triple-checked the syntax, and it is identical to what is in Access. Does anyone have any idea why those columns are not generating properly?
Thanks so much in advance!