[prev in list] [next in list] [prev in thread] [next in thread] 

List:       trac
Subject:    [Trac] Custom Query with more then one Custom Field as WHERE clause
From:       MalaclypsedJ <malaclypsedj () googlemail ! com>
Date:       2015-08-10 19:59:15
Message-ID: 5f6dba06-5c8d-4dad-9637-509baca48408 () googlegroups ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hello,

i have set up following custom query to get the sum of cost from the 
custom_field 'tcf_cost_ap' in table ticket_custom. I'm able to set up a 
WHERE clause on the Table ticket, but how can i do that WHERE clause on 
other custom fields?

I would like to have the same query, but only if the custom field "signed" 
in the table ticket_custom = True.

SELECT sum(c.value) as "Kosten"
  FROM ticket t, ticket_custom c
  WHERE t.id = c.ticket AND t.type = 'Bestellung' AND c.name = 'tcf_cost_ap'

Can anone help me add this criteria?

Thanks in Advance
Dominik

-- 
You received this message because you are subscribed to the Google Groups "Trac \
Users" group. To unsubscribe from this group and stop receiving emails from it, send \
an email to trac-users+unsubscribe@googlegroups.com. To post to this group, send \
email to trac-users@googlegroups.com. Visit this group at \
http://groups.google.com/group/trac-users. For more options, visit \
https://groups.google.com/d/optout.


[Attachment #5 (text/html)]

<div dir="ltr"><div>Hello,</div><div><br></div><div>i have set up following custom \
query to get the  sum of cost from  the custom_field &#39;tcf_cost_ap&#39; in table \
ticket_custom. I&#39;m able to set up a WHERE clause on the Table ticket, but how can \
i do that WHERE clause on other custom fields?</div><div><br></div><div>I  would like \
to have the same query, but only if the custom field &quot;signed&quot; in the table \
ticket_custom = True.</div><div><br></div><div>SELECT sum(c.value) as \
&quot;Kosten&quot;<br>   FROM ticket t, ticket_custom c<br>   WHERE t.id = c.ticket \
AND t.type = &#39;Bestellung&#39; AND c.name = \
&#39;tcf_cost_ap&#39;</div><div><br></div><div>Can anone help me add this \
criteria?</div><div><br></div><div>Thanks in Advance</div><div>Dominik</div></div>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups &quot;Trac \
Users&quot; group.<br /> To unsubscribe from this group and stop receiving emails \
from it, send an email to <a \
href="mailto:trac-users+unsubscribe@googlegroups.com">trac-users+unsubscribe@googlegroups.com</a>.<br \
/> To post to this group, send email to <a \
href="mailto:trac-users@googlegroups.com">trac-users@googlegroups.com</a>.<br /> \
Visit this group at <a \
href="http://groups.google.com/group/trac-users">http://groups.google.com/group/trac-users</a>.<br \
/> For more options, visit <a \
href="https://groups.google.com/d/optout">https://groups.google.com/d/optout</a>.<br \
/>

------=_Part_3887_2069293446.1439236755654--



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic