1) a moderator affects a relationship between an exposure (or independent variable) and an outcome (or dependent variable).
2) An intervening or mediating variable (which I personally would see as the same concept) transmits an effect from the exposure to the outcome. It is like having three domino stones in a row). Once you push the first one, its energy is passed on the second and transmitted by the second passing it further to the third
3) Following from both, the moderator is a statistical concept and can be applied to data (i.e., relationships between variables without a causal interpretation) but also to causal effects (i.e., "effect modifiers"). Better never conflate both. In contrast, the mediator is a causal concept. Mediators have data *implications* but these are not exclusive for the mediator--that is other causal structures have the same implications. In particular, the implications of a mediator model (X --> M --> Y) is the same as those of a confounder model (Y Y). Same data, different reason.
4) A moderator can be a mediator, that is the moderator can be affected by X and be a cause of Y. Its moderating role then refers to a further, direct effect of X on Y. The relevant point is its function (transmitting effects on variables, or modifying effects/relationships
5) Moderators can be continuous or categorical. Analytical methods are subgroup analyses for categorical moderators and moderated regression for continuous and categorical (dummy) variables.
6) Analytical methods for mediators are optimally structural equation modeling or two-stage least squares regression. Regression analysis just refers to the data implications noted in #3. Hence you can not test how strong the causal support for the mediator is, especially if there is a mediator effect plus a direct effect of X. Further, regression analysis will lead to biased effects when the M->Y link is confounded by an omitted common cause. And you have no chance to notice that.
Thank you very much for the answer. It helps me a lot. However, I am still confused in relation to a study using secondary data when confronted to either mediating or moderating variable. I was unable to find an article from reputable journals (my background is in finance and accounting), that uses mediating or moderating variable measured using secondary data (such as total assets or level of debt). Do you any suggestion whether we could employ secondary data for mediating or moderating variable. Yet, your answer clearly suggests that Moderators can be continuous or categorical. Looking forward to receiving your answer.