Forum Replies Created

Viewing 15 posts - 61 through 75 (of 441 total)

  • RE: Query Help

    palotaiarpad (2/24/2016)


    select

    r.ID, r.FULL_NAME, r.FULL_ADDRESS,r.MEMBER_TYPE, r.BIRTH_DATE,

    CONVERT (int,DATEDIFF(hour,r.BIRTH_DATE,GETDATE())/8766)as Age,

    r.Parent1_FullName,r.Parent1_Cell,r.Parent1_Email,

    r.Parent2_FullName,r.Parent2_Cell,r.Parent2_Email

    from IMIS.dbo.vw_csys_registrations r

    WHERE r.MEETING_TYPE='PADA' and r.MEMBER_TYPE LIKE '%CH'

    intersect

    select

    r.ID, r.FULL_NAME, r.FULL_ADDRESS,r.MEMBER_TYPE, r.BIRTH_DATE,

    CONVERT (int,DATEDIFF(hour,r.BIRTH_DATE,GETDATE())/8766)as Age,

    r.Parent1_FullName,r.Parent1_Cell,r.Parent1_Email,

    r.Parent2_FullName,r.Parent2_Cell,r.Parent2_Email

    from IMIS.dbo.vw_csys_registrations r

    WHERE r.MEETING_TYPE='TSM' and r.MEMBER_TYPE LIKE...

  • RE: Query Help

    ScottPletcher (2/23/2016)


    SELECT

    r.ID, r.FULL_NAME, r.FULL_ADDRESS,r.MEMBER_TYPE, r.BIRTH_DATE,

    CONVERT (int,DATEDIFF(hour,r.BIRTH_DATE,GETDATE())/8766)as Age,r.MEETING_TYPE,r.MEETING,r.TITLE,

    r.Parent1_FullName,r.Parent1_Cell,r.Parent1_Email,

    r.Parent2_FullName,r.Parent2_Cell,r.Parent2_Email

    FROM (

    SELECT r2.ID

    FROM IMIS.dbo.vw_csys_registrations r2

    WHERE r2.MEETING_TYPE in ('PADA', 'TSM') AND r2.MEMBER_TYPE...

  • RE: Query Help

    Thank you djj. I modified the query and got the results. I have about 49 unique students registered to both music and dance. Appreciate your help.

    WITH cte1...

  • RE: Query Help

    Sean Lange (2/4/2016)


    SQLisAwE5OmE (2/4/2016)


    Sean Lange (2/4/2016)


    SQLisAwE5OmE (2/4/2016)


    Hi Sean,

    I tried your query, and I am getting the following error.

    Msg 4104, Level 16, State 1, Line 43

    The multi-part identifier "pa.ParentID" could not...

  • RE: Query Help

    Sean Lange (2/4/2016)


    SQLisAwE5OmE (2/4/2016)


    Hi Sean,

    I tried your query, and I am getting the following error.

    Msg 4104, Level 16, State 1, Line 43

    The multi-part identifier "pa.ParentID" could not be bound.

    Msg 207,...

  • RE: Query Help

    Sean Lange (1/25/2016)


    SQLisAwE5OmE (1/25/2016)


    INNER join is fine at the parent info....

    I am confused whats the exact syntax to use under group by clause.

    Basically I need to find out if a...

  • RE: Query Help

    Sean Lange (1/25/2016)


    SQLisAwE5OmE (1/25/2016)


    INNER join is fine at the parent info....

    I am confused whats the exact syntax to use under group by clause.

    Basically I need to find out if a...

  • RE: Query Help

    INNER join is fine at the parent info....

    I am confused whats the exact syntax to use under group by clause.

    Basically I need to find out if a student is registered...

  • RE: Query Help

    Sean Lange (1/25/2016)


    SQLisAwE5OmE (1/25/2016)


    Hi Sean, Thanks for the feedback.

    Sorry for the messy query....I didn't actually write it.....I wish I could write query like that....but thanks for cleaning it up.

    Anyway, I...

  • RE: Query Help

    Hi Sean, Thanks for the feedback.

    Sorry for the messy query....I didn't actually write it.....I wish I could write query like that....but thanks for cleaning it up.

    Anyway, I use crystal reports...

  • RE: Query Help

    drew.allen (1/25/2016)


    Change your criteria to MEETING_TYPE IN ('PADA', 'TSM'), then GROUP BY your parent info, HAVING COUNT(DISTINCT MEETING_TYPE) = 2

    Drew

    Hi Drew,

    I didn't get the groupby caluse....can you put it in...

  • RE: Query Help

    ScottPletcher (1/11/2016)


    SQLisAwE5OmE (1/11/2016)


    ScottPletcher (1/11/2016)


    I would think it would be something like below.

    Note: I assumed from the context that you need to match only the *child's* birthday, even though you said...

  • RE: Query Help

    J Livingston SQL (1/11/2016)


    is there any reason why you cannot / will not provide sample data for your table?

    am sure it will make providing you a tested solution so much...

  • RE: Query Help

    ScottPletcher (1/11/2016)


    I would think it would be something like below.

    Note: I assumed from the context that you need to match only the *child's* birthday, even though you said "all members"....

  • RE: Query Help

    Sean Lange (1/11/2016)


    You desperately need to do some reading about database design and normalization. This table is a mess and appear to be lacking any attempt at normalization.

    As to...

Viewing 15 posts - 61 through 75 (of 441 total)