nmorales

Execute SQL HELP

Discussion created by nmorales on Apr 15, 2014
Latest reply on Apr 15, 2014 by nmorales

Hi All

 

Any SQL experts that can help me?

 

I have a portal where I want to show thru conditional formatting the type of unavailability a specific DJ has.

 

Im using portal filtering so that they can search by Region, Group and DJ Name

 

One type of unavailability is if they are previously booked. This is the executeSQL calc I'm using to find if they are booked

 

"SELECT isLocked

 

FROM EventTalent

INNER JOIN Talent

ON EventTalent.TalentID = Talent.TalentID

WHERE

luEventDate BETWEEN xg_EventDate and xg_EventDateEnd AND

luEventDateEnd BETWEEN xg_EventDate and xg_EventDateEnd

 

This is great because it gives me a list of DJIDs that are booked within date range however in my portal I want to show if that specific related record is booked. I thought I could add the AND (in bold) but that doesn't seem to work. Any ideas?

 

 

 

ExecuteSQL (

 

"SELECT isLocked

FROM EventTalent

INNER JOIN Talent

ON EventTalent.TalentID = Talent.TalentID

WHERE

luEventDate BETWEEN xg_EventDate and xg_EventDateEnd AND

luEventDateEnd BETWEEN xg_EventDate and xg_EventDateEnd AND EventTalent.TalentID=portalname::TalentID'"

; "" ; "" )

)

 

 

Theres a Talent Table for DJs and an EventTalent Table which is a join table between the Talent and the event which has the date and time the DJ will be spinning.

 

Any ideas suggestions are greatly appreciated! Im looking to optimize this pop up and I think this would help greatly.

 


Thank you,

 

Nicole

 

Outcomes