Thomask23
asked on
MONTHLY VARIABLE
I AM WRITING A QUERY THAT WILL NEED TO IDENTIFY VALUES BASED ON THE MONTH. I HAVE THE BELOW, HOWEVER IS THERE A BETTER WAY TO IDENTIFY THE MONTHLY VALUES
,CASE when OffDte>='2014-02-01' AND OffDte<='2014-02-28' THEN 1
ELSE 0 END AS FRESH
,CASE when OffDte>='2014-02-01' AND OffDte<='2014-02-28' THEN 1
ELSE 0 END AS FRESH
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
For starters, make the below change in bold, as <='2014-02-28' will exclude any values of 02-28 after the beginning midnight. See PortletPaul's article Beware of Between for more info
, CASE when OffDte >= '2014-02-01' AND OffDte < '2014-03-01' THEN 1 ELSE 0 END AS FRESH
Also, give us some more details on what you mean by 'IDENTIFY THE MONTHLY VALUES', as that could mean a number of different things