<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Llu&iacute;s,<br>
<br>
First, what version of Views are you using?<br>
<br>
If Views 1 (Drupal 5): what you need then is for your custom module to
implement hook_views_tables().&nbsp; That is how you tell the views module
about your data and define fields and filters that are available to
it.&nbsp; start here: <a href="http://drupal.org/node/99564">http://drupal.org/node/99564</a>
and read through to part 5: Filters.<br>
<br>
If Views 2 (Drupal 6): you need to use hook_views_data() which you can
read more about here: <a
 href="http://views-help.doc.logrus.com/help/views/api-tables">http://views-help.doc.logrus.com/help/views/api-tables</a>.&nbsp;
from that documentation page, in the Describing Fields On Tables
section: "...<span class="Apple-style-span"
 style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><span
 class="Apple-style-span"
 style="color: rgb(73, 73, 73); font-family: Verdana; font-size: 12px; line-height: 20px;"><span
 class="Apple-converted-space"> </span>each table can also have an
unlimited number of field designations; these correspond roughly to
fields on the table, though it is very common to use non-fields to
display data that isn't directly in a field, such as data arrived from
formulae...</span></span>"<br>
be sure to have a look at <a
 href="http://views-help.doc.logrus.com/help/views/api">http://views-help.doc.logrus.com/help/views/api</a>
as well for info on using hook_views_api() and where the other views
hooks should be placed.<br>
<br>
Seth<br>
<br>
Llu&iacute;s wrote:
<blockquote
 cite="mid:45a29f450908250620r635aa30y1ada0cd9b5ec680d@mail.gmail.com"
 type="cite">
  <pre wrap="">On Tue, Aug 25, 2009 at 2:55 PM, Jocimar Lopes<a class="moz-txt-link-rfc2396E" href="mailto:gavranha@rankcine.com">&lt;gavranha@rankcine.com&gt;</a> wrote:
  </pre>
  <blockquote type="cite">
    <pre wrap="">Hi, Llu&iacute;s

have you tried computed_field module? If a understood you question, it may
solve that.
    </pre>
  </blockquote>
  <pre wrap=""><!---->
If I am right computed_field is useful when using cck, but I am using
a custom module with custom content types.
I am trying to write a module to allow SQL operations using hidden
fields inside the query. I thing it is the best option because there
is no redundant data.

My final query should look like: SELECT (a+b) AS any_alias, C FROM
table GROUP BY C
I have had a look at views_calc but it cannot work with grouped queries.

  </pre>
  <blockquote type="cite">
    <pre wrap="">[]s

Llu&iacute;s wrote:
    </pre>
    <blockquote type="cite">
      <pre wrap="">I have a view with two fields (A and B), both of them numeric. I want
to make a filter to show nodes when A + B = 0

How can I make this? I suppose I should add A and B as hidden fields
and then there should be a calculated field anywhere allowing to
add(), concatenate(), .... But I have been unable to find this module.

Thanks


      </pre>
    </blockquote>
    <pre wrap="">--
[ Drupal support list | <a class="moz-txt-link-freetext" href="http://lists.drupal.org/">http://lists.drupal.org/</a> ]

    </pre>
  </blockquote>
  <pre wrap=""><!---->


  </pre>
</blockquote>
</body>
</html>