3003Re: SQL If statement????
- Aug 1, 2007Hi - Thankyou for the help
basically I have a query that is looking for say X in table 1.
If X is in table one, all is good. If it is not, I want the query to
populate a Y. Is this possible?
--- In SQLQueriesNoCode@yahoogroups.com, srussell@... wrote:
> > hi,
> > This is what I understand from your point. If I mis-understand
or my point
> > is not very clear then let me know and clarify your case with
> > example:
> > I think you wanna result set; if Table A does not contain the
> > then
> > you want it to replace it with some other field.
> > Now you can check it with the count of the result set and if
count is zero
> > then you can return the default values and if count is 1 or
> > you
> > can return the actual values.
> Try either CASE or ISNULL for T-SQL substitutions as needed.
- << Previous post in topic Next post in topic >>