SUM and MUL in SQL for Navision Attain

Jonny_BoströmJonny_Boström Member Posts: 2
edited 2003-11-21 in Navision Attain
I am building a report in Excel that uses C/ODBC to fetch data from the Navision Attain database.

I need help with examples for how to use the SUM and MUL (mulitiplication) from the Navision database.

1) Is there no way to use the "SUM(field) AS name" - I have tried but it only works if I omit the "AS name" part from the query - please answer with an example of a SQL-query

2) Is there no way to be able to use two or more of the SUM-functions within the same query? - please answer with an example of a SQL-query

3) Is it possible to use multiplication in SQL to the database? According to the manual I have seen (w1w1codbc.pdf) one can use MUL but I need help with an example of a SQL-query

Thanks,
Jonny

Comments

  • sabatosabato Member Posts: 15
    Hey,

    almost everything you asked for is possible.

    First of all here is the SQL Query with on SUM function:
    SELECT 
      Nr_ , 
      Name, 
      Adress, 
      City, 
      Sum (*fieldname*) as *name* 
    FROM
      Customer
    WHERE
      Nr_ = *Fieldname* or *Value* or *whatever* 
    

    You Second question could be just the same, but with just one more SUM function. That shouldn't be a problem for you =)

    Hope this helps a little.

    Greetinx
    sabato
Sign In or Register to comment.