Computing.Net > Forums > Programming > SQL recodes

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Click here to start participating now! Also, check out the New User Guide.

SQL recodes

Reply to Message Icon

Name: scritti_2000
Date: March 16, 2004 at 08:32:58 Pacific
OS: Windows 2000
CPU/Ram: 260 KB
Comment:

Hello,

I have a SQL script below that gives me recoded values into separate columns, one column per specific recode. Is there any type of SQL program that will put all recodes in just "1 column"?

SELECT DISTINCT tblDemographics.lname, tblDemographics.pid, vw_HFS_SIPS.ID, tblDemographics.frmdate, First(DateDiff("m",[frmdate],[examdate])) AS [The Value], IIf([The Value] Between 3 And 8.99,"1"," ") AS Six, IIf([The Value] Between 9 And 14.99,"1"," ") AS OneYear, IIf([The Value] Between 15 And 20.99,"1"," ") AS 18, IIf([The Value] Between 21 And 26.99,"1"," ") AS TwoYear, IIf([The Value] Between 27 And 32.99,"1"," ") AS 30, IIf([The Value] Between 33 And 38.99,"1"," ") AS ThreeYear, IIf([The Value] Between 39 And 45.99,"1"," ") AS 42, IIf([The Value] Between 46 And 51.99,"1"," ") AS FourYear, IIf([The Value] Between 52 And 57.99,"1"," ") AS 54, IIf([The Value] Between 58 And 300,"1"," ") AS 5ormore
FROM tblDemographics INNER JOIN vw_HFS_SIPS ON tblDemographics.id_num = vw_HFS_SIPS.ID
GROUP BY tblDemographics.lname, tblDemographics.pid, vw_HFS_SIPS.ID, tblDemographics.frmdate, vw_HFS_SIPS.EXAMTYPE
HAVING (((tblDemographics.pid)=11 Or (tblDemographics.pid)=12 Or (tblDemographics.pid)=13) AND ((First(DateDiff("m",[frmdate],[examdate])))>=3))
ORDER BY tblDemographics.pid DESC;


Rus Kehoe



Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


filtering visitors from p... Java JRadioButton mouseCl...



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: SQL recodes

MS Access recoding values www.computing.net/answers/programming/ms-access-recoding-values/9891.html

how to schedule a sql job using batch file www.computing.net/answers/programming/how-to-schedule-a-sql-job-using-batch-file/20376.html

SQL Server, Oracle linked server www.computing.net/answers/programming/sql-server-oracle-linked-server/7518.html