Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL view: how to use <= in case construction 1

Status
Not open for further replies.

fmientjes

Programmer
Mar 27, 2002
55
NL
In a view I want to get an amount when the month is less than or equal to 3 (march).
The following code is not accepted, but I don't know why:

CASE MONTH(dbo.gbkmut.date) WHEN <=3 THEN amount ELSE 0 END AS 'YTD_03_Mar'

If I change it to "WHEN 3" it works, but only for March.
Can someone give me a hint over how to achieve the amount when the month is less than or equal to March?

Thanks,
Frans
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top