We help IT Professionals succeed at work.

Evaluate Twice?

rick
rick asked
on
76 Views
Last Modified: 2017-03-29
Is there a better way to write this and not have to do the evaluation (DATEADD) twice?  

The second line does the same calc as the first row.  The query works, but i'm looking for effiency.

      
       
DATEADD(day, ISNULL(TT.PFL, 90) , [exam begin])  EXAN_BEGIN_PFL,
	CASE WHEN DATEADD(day, ISNULL(TT.PFL, 90) , [exam begin]) > GETDATE() THEN 'N' ELSE 'Y' END,

Open in new window

Comment
Watch Question

IT Engineer
CERTIFIED EXPERT
Distinguished Expert 2017
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Author

Commented:
Thanks, buddy!
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.