|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2002-05-31 : 09:07:54
|
| Curt writes "I have an existing access query that works fine, but it will not work as an SQL view. Why not? It is having problems with the 'if' statements, and the quotes also, I think. How does it work in SQL?I am running SQL Server 2000 - SP2 on a Windows 2000 server.SELECT fips.fips, fips.county, ca05title.order, ca05title.title, ca05title.line, IIf([80]=1,"(D)",IIf([80]=2,"(L)",IIf([80]=3,"(E)",IIf([80]=9,"NA",IIf([1980y]=0,"0",Format([1980y],"#,###")))))) AS 1980, IIf([90]=1,"(D)",IIf([90]=2,"(L)",IIf([90]=3,"(E)",IIf([90]=9,"NA",IIf([1990y]=0,"0",Format([1990y],"#,###")))))) AS 1990, IIf([95]=1,"(D)",IIf([95]=2,"(L)",IIf([95]=3,"(E)",IIf([95]=9,"NA",IIf([1995y]=0,"0",Format([1995y],"#,###")))))) AS 1995, IIf([99]=1,"(D)",IIf([99]=2,"(L)",IIf([99]=3,"(E)",IIf([99]=9,"NA",IIf([1999y]=0,"0",Format([1999y],"#,###")))))) AS 1999FROM (ca05title INNER JOIN CA05BEA ON ca05title.title = CA05BEA.title) INNER JOIN fips ON CA05BEA.fips = fips.fipsORDER BY fips.fips, ca05title.order;This is copied directly from the query; sorry if it is confusing." |
|