Sunan Abu Dawud #5208
General Behavior (Kitab Al-Adab) 43:436
Narrated AbuHurayrah:
The Prophet (ﷺ) said: When one of you comes to an assembly, he should give a salutation and if he feels inclined to get up, he should give a salutation, for the former is not more of a duty than the latter.