Link to home
Create AccountLog in
Avatar of thayduck
thayduckFlag for United States of America

asked on

SQL Where Statement

Is this the correct way  (or what is best way) to write this sql 2008 statement:

Where

 (prd.Year + prd.Month) >= (@Fyear + @Fmonth)
             AND (prd.Year + prd.Month) <=  (@Tyear + @Tmonth)        

prd.year, prd.month, @Fyear, @Fmonth, @Tyear and @Tmonth are all  INT.


prd.year and prd.month are from table called prd. Only want to select prd records if they are between (parms) 201208 and 201306.
ASKER CERTIFIED SOLUTION
Avatar of Patrick Matthews
Patrick Matthews
Flag of United States of America image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of thayduck

ASKER

Does exactly what I need it to do.

Thanks...