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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Don't laugh, Easy one, Avg a case statement 1

Status
Not open for further replies.

Tapew0rm

Technical User
Jan 25, 2002
13
0
0
US
Hi,

Ok this should be easy but I obviously woke up on the stupid side of the bed. Here is what i'm tring to do basicly...

AVG (( Case

When X = Y

Then 1

Else 2) - (1))

End as Field_Name,


I keep getting incorrect syntax near ')'
 
Code:
avg( Case        
     When X = Y
           Then 1
     Else 2 - 1 End) as Field_Name

Your ENTIRE case statement needed to be within the paren's.

Hope this helps,

Alex

[small]----signature below----[/small]
I don't do any programming whatsoever

Ignorance of certain subjects is a great part of wisdom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top