CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> ASP

 SQL (Datasource) Help

Print topic Send  topic

Author Message
Dean L Covey
Posted: 10/11/2005, 6:47 PM

This seems possible, I just can't get into CCS. This grid works GREAT as is.

I have a grid where its datasource is a MS-Access table and the following Where clause:

SELECT *
FROM UserData
WHERE Name LIKE '%{s_Name}%'
AND Email LIKE '%{s_Email}%'
AND [Group] = {s_Group}
AND Status LIKE '%{s_Status}%'
AND ClientID = {CookieClient}

What I'd like to do is if the Group is 10 then ignore the ClientID = {CookieClient} . I can clear the {CookieClient} if the user is in the Group of 10 at the login if that would help. What is the best way to handle this?

I noticed parameters prompt offers use "Is Null" Condition. Does that help me in any way? What is this for anyhow?
mrachow


Posts: 509
Posted: 10/12/2005, 12:52 AM

In event BeforeBuildSelect you can enter something like
if CInt(CCGetFromGet("s_Group", "0")) <> 10 then
yourForm.DataSource.Where = yourForm.DataSource.Where & " AND " & ClientID = " & ...getCookieClient...
end if

In regard to is null I think (really don't know for sure) that CCS removes parameters from where if source is empty.
Maybe using this it would check for is null instaed removing it.

_________________
Best regards,
Michael
View profile  Send private message
DonB
Posted: 10/12/2005, 6:31 AM

You need to change the last line to

AND (ClientID = {CookieClient} OR {s_Group} = 10)

which would require changing the Data Source type to "SQL" (if it is still
"Table")


The Is Null option modifies the query parameter that ordinarily is expressed
as 'somecolumn={somevalue}'. Normally, a term is dropped from the where
clause if the corresponding parameter is not provided. By checking the "Is
Null", when the parameter is omitted, the term is retained in the Where, but
changed to 'somecolumn IS NULL' (or IS NOT NULL). Look at Classes.asp, and
specifically, clsSQLParameters.

--
DonB

http://www.gotodon.com/ccbth


<Dean LCovey@forum.codecharge (Dean L Covey)> wrote in message
news:6434c6b2f067d4@news.codecharge.com...
> This seems possible, I just can't get into CCS. This grid works GREAT as
is.
>
> I have a grid where its datasource is a MS-Access table and the following
Where
> clause:
>
> SELECT *
> FROM UserData
> WHERE Name LIKE '%{s_Name}%'
> AND Email LIKE '%{s_Email}%'
> AND [Group] = {s_Group}
> AND Status LIKE '%{s_Status}%'
> AND ClientID = {CookieClient}
>
> What I'd like to do is if the Group is 10 then ignore the ClientID =
> {CookieClient} . I can clear the {CookieClient} if the user is in the
Group of
> 10 at the login if that would help. What is the best way to handle this?
>
> I noticed parameters prompt offers use "Is Null" Condition. Does that
help me
> in any way? What is this for anyhow?
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>


Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.