Loading ...
Sorry, an error occurred while loading the content.

3001Re: [SQLQueriesNoCode] SQL If statement????

Expand Messages
  • Muhammad Ahmed
    Aug 1, 2007
      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 the example:

      I think you wanna result set; if Table A does not contain the reference 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 greater then you
      can return the actual values.

      You can always refer to the TSQL help from Query Analyzer if you are new to
      T-SQL.

      Regards,
      Muhammad Ahmed

      On 7/31/07, sjcwhittle <sjcwhittle@...> wrote:
      >
      > Very new to sql - but I am trying to bascially use a function similar
      > to the if s'tmt in excel.
      >
      > Bascially the If st'mt will query Table A - but my problem is if the
      > ref I am looking up is not in table A, I want to replace it with a
      > default field rather than jsut not including it????
      >
      > Is this possible?
      >
      >
      >
      >
      > Yahoo! Groups Links
      >
      >
      >
      >


      --
      Regards,

      Muhammad Ahmed


      [Non-text portions of this message have been removed]
    • Show all 9 messages in this topic