Page 2 of 2 FirstFirst 12
Results 16 to 19 of 19

Thread: MS SQL 2000 Backup.

  1. #16
    Join Date
    Nov 2002
    Location
    New Jersey, USA
    Posts
    3,932
    What do you mean by diff result?. If you want to display only weekday result then filter the rows by using DATEPART function with DW parameter.

  2. #17
    Join Date
    Mar 2003
    Location
    NJ
    Posts
    201
    select
    DMA,Dates,case when datepart(dw,Dates) in (7,1) then 'Weekend' else 'WeekDay' end from dma

  3. #18
    Join Date
    Feb 2004
    Posts
    64
    Thanks again. Another Question.

    I have tables as below.
    Table A

    DMA CD Zip_code
    -------------------------------
    501 2708 07625
    501 2708 07624
    201 2708 07628
    201 2709 07625
    201 2706 07248

    Table B

    State zip_Code
    -----------------
    NJ 07624
    NJ 07625
    NY 10023
    NY 10024

    So I join the Table A & Table B with Zip_Code I get only matching rows. How I can get non matching rows. I know it is with join type.

    Thanks.

  4. #19
    Join Date
    Nov 2002
    Location
    New Jersey, USA
    Posts
    3,932
    select a.dma, a.cd, a.zip_code, b.state
    from tablea as a
    left outer join tableb as b
    on a.zip_code = b.zip_code

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •