View ProjeQtOr On SourceForge.net
ProjeQtOr - Project Management Tool
Support us on Capterra
OIN - Open Invention Network
ProjeQtOr free project management software - execute a request personalized - ProjeQtOr
 
 

execute a request personalized

More
11 Dec 2012 17:34 #1 by yassine
i can't execute this request with sqlElement :dry:
SELECT count(distinct `idResource`,`workDate`)FROM `work` WHERE `week`=201248

Please Log in or Create an account to join the conversation.

More
11 Dec 2012 18:12 #2 by babynus
Not really ANSI SQL compliant.
Try
select count(*) from 
(SELECT distinct `idResource`,`workDate` FROM `work` WHERE `week`=201247) as ww

Babynus
Administrator of ProjeQtOr web site

Please Log in or Create an account to join the conversation.

More
11 Dec 2012 18:16 #3 by yassine
this is my code

$Ressource=SqlList::getList('Resource');
foreach($Ressource as $keyresource => $valresource)
{
$crit=array('week'=>$y.''.$week);
$obj=new Work();
$Jours=$obj->countSqlElementsFromCriteria($crit);
}

Please Log in or Create an account to join the conversation.

More
11 Dec 2012 19:26 #4 by yassine
So i should modify the file sqlElement.php.
But i try this way w and i can't create a new function to generate a request to reply this need.

Please Log in or Create an account to join the conversation.

More
11 Dec 2012 20:31 #5 by babynus
Sure this code
$Ressource=SqlList::getList('Resource');
foreach($Ressource as $keyresource => $valresource) 
{ 
$crit=array('week'=>$y.''.$week);
$obj=new Work();
$Jours=$obj->countSqlElementsFromCriteria($crit);
}
will not generate
SELECT count(distinct `idResource`,`workDate`)FROM `work` WHERE `week`=201248
unless you changed SqlElement code (I stongly recommand against this !).
It will more likely generate
select count(*) as cpt from work where week='201248'

Babynus
Administrator of ProjeQtOr web site

Please Log in or Create an account to join the conversation.

More
11 Dec 2012 20:34 #6 by babynus
Maybe if you describe what you try to get (and not how you try to get it), answers may be more helpfull. ;)

Babynus
Administrator of ProjeQtOr web site

Please Log in or Create an account to join the conversation.

Moderators: babynusprotion
Time to create page: 0.041 seconds

Cookies settings

×

Functional Cookies

Ce site utilise des cookies pour assurer son bon fonctionnement et ne peuvent pas être désactivés de nos systèmes. Nous ne les utilisons pas à des fins publicitaires. Si ces cookies sont bloqués, certaines parties du site ne pourront pas fonctionner.

Session

Please login to see yours activities!

Other cookies

Ce site web utilise un certain nombre de cookies pour gérer, par exemple, les sessions utilisateurs.