katrina11
Technical User
- Apr 30, 2011
- 108
I know how to do it in SAS but have no idea how to implement this conditional calculation in SQL Server 2005
select
field1
,field2
,??????
into desiredTable
FROM myTable
LOS is a length of Stay in hospital(in days) while
two other fields are dates . For ex. Admitdt looks like 2010-11-16 00:00:00
How can I implement the SELECT query with calculation?
Any help would greatly appreciated
Katrin
The thing is that I would like to calculate HospDischDate=AdmitDt + LOSP in the body of Select Query:if LOSp=. then LOSp=0;
HospDischDate=intnx('DtDay', Admitdt, LOSp)
select
field1
,field2
,??????
into desiredTable
FROM myTable
LOS is a length of Stay in hospital(in days) while
two other fields are dates . For ex. Admitdt looks like 2010-11-16 00:00:00
How can I implement the SELECT query with calculation?
Any help would greatly appreciated
Katrin