mardaloop
Posts: 4
|
| Posted: 09/30/2010, 7:04 AM |
|
I am using the GUI SQL Query Builder and am using a Paramter Selection. I have a query that selects records according to USERID, that works fine.
But, I need to add an additional qualifier to select only those records that have a Status of "A" (active).
I can select the AND drop down, but cannot add anything.
So the Query needs this:
SELECT *
FROM myTable
WHERE status = 'A' and user_id = USERID (of course this wont' work because SQL has no idea what USERID is.
Here is the code CCS generates:
SELECT *
FROM USR_Campaigns
WHERE ( campaign_user_id = {Expr0} )
AND status = '{Expr1}'
Do I need to put this into a Before Event or something and if so, how would one code this?
Thank you
Marda.
|
 |
 |
Jan van Dalen
|
| Posted: 09/30/2010, 7:56 AM |
|
Hello mardaloop,
Can you type it in? WHich view are you using? SQL?
> I am using the GUI SQL Query Builder and am using a Paramter
> Selection. I have a query that selects records according to USERID,
> that works fine.
>
> But, I need to add an additional qualifier to select only those
> records that have a Status of "A" (active).
>
> I can select the AND drop down, but cannot add anything.
>
> So the Query needs this:
> SELECT *
> FROM myTable
> WHERE status = 'A' and user_id = USERID (of course this wont' work
> because SQL
> has no idea what USERID is.
> Do I need to put this into a Before Event or something and if so, how
> would one code this?
>
> Thank you
> Marda.
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
|
|
|
 |
mardaloop
Posts: 4
|
| Posted: 09/30/2010, 10:50 AM |
|
Hi Jan, here are the steps I take:
1) Click on Datasource then the Elipses,
2) Table View, click on Where,
3) Click on Pluse (+),
4) Select my column from the drop down, Equals, USERID, Session. I can click on the drop down list for the Condition Clause, select AND click OK,
5) Right click Where (or Plus Sign) to add another where condition,
6) Select my column, EQUALS, A (the letter A for active), Expresssion, click OK.
This is the resultant SQL statemetn:
SELECT *
FROM USR_Campaigns
WHERE (( campaign_user_id = {USERID} ) --->>> This will work
AND ( status = '{Expr0}' )) --->>> ths fails
When I build and run, I get this IE error:
An error occurred on the server when processing the URL. Please contact the system administrator.
If you are the system administrator please click here to find out more about this error.
ASP is enabled and works fine on the system. I'm guessing its the where condition clause, even if I try to surround the A with Quotes or Single Quotes, i still get the same error.
Hopefully this helps.
|
 |
 |
Oper
Posts: 1195
|
| Posted: 10/04/2010, 4:33 PM |
|
IIS7 or IIS6?
that not the real Error.
To View the Real error you need to Enable send error to Browser.
_________________
____________________________
http://www.7bz.com (Free CMS,CRM Developed in CCS)
http://www.PremiumWebTemplate.com
Affiliation Web Site Templates
Please do backup first |
 |
 |
|