CodeCharge Studio
search Register Login  

Web Reports

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

YesSoftware Forums -> CodeCharge Studio -> PHP

 CCDLookup, where statement help

Print topic Send  topic

Author Message
Casey
Posted: 08/24/2004, 11:42 PM

CCDLOOKUP help please, my first attempt at PHP.

From grid name grdProjects, I want to lookup into another table.

Table to look into is named Milestone
It has a FK of column named ProjectId

My grdProjects SQL has a column containing the ProjectId, but that is not shown in the grid, it is hidden.

How do I code the where-statement part of the CCDLookup?
$result = CCDLookup("MilestoneId","Milestone","ProjectId =".???????????, $PMRTest);

Tks.
Casey
Damian
Posted: 08/25/2004, 6:00 AM

Under Grid Properties - Click on the [...] next to Data Source
In the Dialogue box click on Build Query
Click on the +[] icon and add your second table
Delete any auto-created links and then link betwen the fields that are the
same between the 2 tables
Choose Inner/Left/Right join
Then back in the Data Source you can add your where statements...



"Casey" <Casey@forum.codecharge> wrote in message
news:5412c34bf0f4fe@news.codecharge.com...
> CCDLOOKUP help please, my first attempt at PHP.
>
> From grid name grdProjects, I want to lookup into another table.
>
> Table to look into is named Milestone
> It has a FK of column named ProjectId
>
> My grdProjects SQL has a column containing the ProjectId, but that is not
shown
> in the grid, it is hidden.
>
> How do I code the where-statement part of the CCDLookup?
> $result = CCDLookup("MilestoneId","Milestone","ProjectId =".???????????,
> $PMRTest);
>
> Tks.
> Casey
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>

casey
Posted: 08/25/2004, 2:42 PM

Thanks,
But that is not what I need.
I've already set my query across many tables and I wish to take an action conditional upon a record existing or not, in a child table.

A flag set by a dlookup is what I want.

So my question remains open.

Thanks
Casey



Casey
Posted: 08/25/2004, 10:32 PM

Sorry to bump this but I'm going nowhere on my own ...

In the abovementioned grid, Before Show event for Label Mstone1, have tried these code attempts (amongst other failures).

$result = CCDLookUp("MilestoneId", "Milestone", " ProjectId = ".$DBPMRtest->ToSQL($grdProjects->ProjectId->GetValue(), ccsInteger), $DBPMRTest));

$result = CCDLookUp("max(MilestoneId)", "Milestone", "ProjectId =" .$DBPMRTest->ToSQL($grdProjects->ProjectId,$ccsInteger), $DBPMRTest);

with $grdProjects->Mstone1->SetValue($result); to pass back the value.

...and I do need the CCDLookup

The first one results in a blank browser page, nothing at all in the browser, so it seriously stuffs up!
The second one shows the full grid correctly EXCEPT all the Mstone1 values are zero, when a variety of 'lookup-up' numbers should result.

This is so basic it's embarrassing - 20 seconds in ASP - but I'm plain stonked here.
Don Safar
Posted: 08/26/2004, 8:59 AM

First, you should be using the "before show row" event and not the "before
show" event. then try below for ccdlookup.
$result = CCDLookUp("max(MilestoneId)", "Milestone", "ProjectId
=".$grdProjects->ProjectId->GetValue(), $DBPMRTest);

"Casey" <Casey@forum.codecharge> wrote in message
news:5412d75f6ee7b1@news.codecharge.com...
> Sorry to bump this but I'm going nowhere on my own ...
>
> In the abovementioned grid, Before Show event for Label Mstone1, have
tried
> these code attempts (amongst other failures).
>
> $result = CCDLookUp("MilestoneId", "Milestone", " ProjectId =
> ".$DBPMRtest->ToSQL($grdProjects->ProjectId->GetValue(), ccsInteger),
> $DBPMRTest));
>
> $result = CCDLookUp("max(MilestoneId)", "Milestone", "ProjectId ="
> $DBPMRTest->ToSQL($grdProjects->ProjectId,$ccsInteger), $DBPMRTest);
>
> with $grdProjects->Mstone1->SetValue($result); to pass back the value.
>
> ..and I do need the CCDLookup
>
> The first one results in a blank browser page, nothing at all in the
browser,
> so it seriously stuffs up!
> The second one shows the full grid correctly EXCEPT all the Mstone1
values are
> zero, when a variety of 'lookup-up' numbers should result.
>
> This is so basic it's embarrassing - 20 seconds in ASP - but I'm plain
> stonked here.
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>

Casey
Posted: 08/26/2004, 9:28 PM

Thanks Don,

Appreciate your help.
You have provided the result I was looking for, but I've placed the code in the Before Show of the row item.

I''ve placed it there in the gridrow because I have alternate row coloring, thus a Before Row Show will not work completely, (as the ProjectId becomes Alt_ProjectId on the alternate rows).

Thanks,
Casey

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.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


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