Good afternoon. Is it possible to use a 'created' field name in a "WHERE" statement?
Some of our tables contain entries where the record was opened (presumably in eror) and closed at the same time so when we calculate the difference the result is 0. What I thought might be useful would be to eclude the records at selection time. Here is what I mean:
Many thanks,
DÇ$
Some of our tables contain entries where the record was opened (presumably in eror) and closed at the same time so when we calculate the difference the result is 0. What I thought might be useful would be to eclude the records at selection time. Here is what I mean:
Case
When Datediff(day,epstart,EpEnd)/365.25 is Null
Then Datediff(day,epstart,getdate())/365.25
Else Datediff(day,epstart,EpEnd)/365.25
End As StayYears
WHERE StayYears <> 0
Many thanks,
DÇ$