Forum Replies Created

Viewing 15 posts - 76 through 90 (of 442 total)

  • RE: Query Help

    GilaMonster (1/11/2016)


    Table definitions and sample data please.

    Hi Gail,

    I have attached the create script for dbo.Name

    Regards,
    SQLisAwe5oMe.

  • RE: Help in using date range

    Thanks Jacob, that worked.

    I also tried this way and it worked as well, just FYI.

    Select * from activity where product_code like '%WELL%' and transaction_date between '2013-01-01' and '2014-12-31'

    Thanks again.

    Regards,
    SQLisAwe5oMe.

  • RE: Help with a query, plz

    SQLisAwE5OmE (12/30/2015)


    Not after I modified the script as Alan mentioned as below.

    SELECT DISTINCT females_only.*

    From dbo.vw_csys_NurserySchool

    Cross Apply (

    SELECT Parent1_id, Parent1_FullName, Parent1_Email, Parent1_STATUS, Parent1_Gender, YEAR, FULL_ADDRESS

    WHERE Parent1_Gender = 'F'

    UNION ALL

    SELECT Parent2_id, Parent2_FullName,...

    Regards,
    SQLisAwe5oMe.

  • RE: Help with a query, plz

    Okay, Thanks for your inputs. Appreciate it.

    Regards,
    SQLisAwe5oMe.

  • RE: Help with a query, plz

    Jeff Moden (12/30/2015)


    SQLisAwE5OmE (12/30/2015)


    I tried to include the CATEGORY field to the script Jeff provided and it seems working, but my only concern is, this doesn't pull the parent2 field....as...

    Regards,
    SQLisAwe5oMe.

  • RE: Help with a query, plz

    I tried to include the CATEGORY field to the script Jeff provided and it seems working, but my only concern is, this doesn't pull the parent2 field....as my original script....so,...

    Regards,
    SQLisAwe5oMe.

  • RE: Help with a query, plz

    ScottPletcher (12/30/2015)


    SELECT DISTINCT females_only.*

    From dbo.vw_csys_NurserySchool

    Cross Apply (

    SELECT Parent1_id, Parent1_FullName, Parent1_Email, Parent1_STATUS, Parent1_Gender, YEAR, FULL_ADDRESS

    WHERE Parent1_Gender = 'F' AND CATEGORY <> 'STF'

    UNION

    SELECT Parent2_id, Parent2_FullName, Parent2_Email, Parent2_STATUS, Parent2_Gender,YEAR, FULL_ADDRESS

    WHERE Parent2_Gender = 'F'...

    Regards,
    SQLisAwe5oMe.

  • RE: Help with a query, plz

    SQLisAwE5OmE (12/30/2015)


    Not after I modified the script as Alan mentioned as below.

    SELECT DISTINCT females_only.*

    From dbo.vw_csys_NurserySchool

    Cross Apply (

    SELECT Parent1_id, Parent1_FullName, Parent1_Email, Parent1_STATUS, Parent1_Gender, YEAR, FULL_ADDRESS

    WHERE Parent1_Gender = 'F'

    UNION ALL

    SELECT Parent2_id, Parent2_FullName,...

    Regards,
    SQLisAwe5oMe.

  • RE: Help with a query, plz

    Not after I modified the script as Alan mentioned as below.

    SELECT DISTINCT females_only.*

    From dbo.vw_csys_NurserySchool

    Cross Apply (

    SELECT Parent1_id, Parent1_FullName, Parent1_Email, Parent1_STATUS, Parent1_Gender, YEAR, FULL_ADDRESS

    WHERE Parent1_Gender = 'F'

    UNION ALL

    SELECT Parent2_id, Parent2_FullName, Parent2_Email,...

    Regards,
    SQLisAwe5oMe.

  • RE: Help with a query, plz

    Jeff Moden (12/29/2015)


    SQLisAwE5OmE (12/29/2015)


    Jeff, See the attachment for the create view script. Thanks.

    Thanks for that. That view is a bit of a "Rosetta Stone" for what the table...

    Regards,
    SQLisAwe5oMe.

  • RE: Help with a query, plz

    Jeff, See the attachment for the create view script. Thanks.

    Regards,
    SQLisAwe5oMe.

  • RE: Help with a query, plz

    Thnx again Jeff for trying. I am learning.

    Regards,
    SQLisAwe5oMe.

  • RE: Help with a query, plz

    I am really sorry Jacob. Thank you!....that seems working now.

    SELECT DISTINCT females_only.*

    From dbo.vw_csys_NurserySchool

    Cross Apply (

    SELECT Parent1_id, Parent1_FullName, Parent1_Email, Parent1_STATUS, Parent1_Gender, YEAR, FULL_ADDRESS

    WHERE Parent1_Gender = 'F'

    UNION ALL

    SELECT Parent2_id, Parent2_FullName,...

    Regards,
    SQLisAwe5oMe.

  • RE: Help with a query, plz

    Yes, I tried with distinct as I mentioned earlier, but still duplicates shows.

    Unless I am inserting distinct at wrong place. See below

    Select females_only.*

    From dbo.vw_csys_NurserySchool

    Cross Apply (

    SELECT distinct Parent1_id, Parent1_FullName,...

    Regards,
    SQLisAwe5oMe.

  • RE: Help with a query, plz

    Thanks Scott, it still gives duplicates even after changing as you mentioned.

    Anyway, thank you, at least I've got the list, I will export to excel and remove duplicates.

    Thank you again...

    Regards,
    SQLisAwe5oMe.

Viewing 15 posts - 76 through 90 (of 442 total)