I have a view with two tables and three fields

tables are called SC011000 and SC33013
the fields are called SC01049 and SC33013 both are datetime fields.

I want to make the third field show the biggest date.
but i am doing something wrong

I am typing in
case when dbo.SC331000.SC33013 > dbo.SC011000.SC01049 then dbo.SC331000.SC33013 else dbo.SC011000.SC01049

I get unable to parse experession. please can someone help?

Recommended Answers

post following
1) full structure of your views with sample data.
2) full query you are trying to get result
3) sample result expected from sample data above

Jump to Post

All 2 Replies

post following
1) full structure of your views with sample data.
2) full query you are trying to get result
3) sample result expected from sample data above

You need to put "end" at the end. A "case" statement requires that.

case when dbo.SC331000.SC33013 > dbo.SC011000.SC01049 
then dbo.SC331000.SC33013 
else dbo.SC011000.SC01049 
END
Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.