Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have a SQL load which i want to incorporate a where clause in. I have done it before but I can't seem to get it working now and I am not doing anything else.
My script looks like this:
SQL SELECT
ActualEnd,
ActualStart,
`lut_Event_Id` as EventID,
`lut_SponsorRevenue` as SponsorRevenue,
Name as CampaignName,
`OwnerId_Name` as UserName,
Id as CampaignID
ProposedEnd,
ProposedStart,
StateCode as CampaignStatus,
TypeCode as CampaignType
FROM CData.Campaign
where StateCode = 'Active';
Any idea what is going wrong?
Regards, Paul
Guys, I found it.
Your post got me thinking Vikas so I tried, Statuscode = '1' instead of Active and this worked! For some strange reason all the previews show the name but somewhere under water in the database it is called 0 and 1
Regards ,Paul
What do you mean with 'not working'?
Do you get an error message?
Or do you see more records with other StateCode than 'Active'?
What if you run only this code in a script (no further LOADs, with possible autoconcatenated records to your table)?
Paul
Does it fail (with error message) or just give unexpected results ?
There is no comma after "Id as CampaignID"
Sorry guys forgot to attach the error screenshots (error is to long so I made 2 screenshots to capture the full sentence)
Find attached. I have never encountered that error before
check with StateCode filed whether it is 'Active' , I think it should have some different values
Vikas
I checked but in the preview it gives me the exact values.
Regards, Paul
Guys, I found it.
Your post got me thinking Vikas so I tried, Statuscode = '1' instead of Active and this worked! For some strange reason all the previews show the name but somewhere under water in the database it is called 0 and 1
Regards ,Paul
I think there is some kind of enum used for that field.
you can mark correct ans to those post who have given you correct feedback.
Vikas