Results 1 to 2 of 2

Thread: SQL problem

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2001
    Location
    Belgium (Bruges)
    Posts
    88

    SQL problem

    Hi all,

    with the following command in sql i have some problems:

    SELECT verkoop.produkt AS omschrijving, verkoop.datum as datumverk, Sum(verkoop.aantal) AS totaal, verkoop.datum, Sum([prijseuro]*[aantal]) AS Totprijs, " FROM verkoop LEFT JOIN produkten ON verkoop.produkt = produkten.omschrijving GROUP BY verkoop.produkt, verkoop.datum HAVING ((verkoop.produkt)<>'Laten Staan') and (verkoop.datum) between #" & Format$(PrintDialog.calbegin.Text, "mm/dd/yyyy") & "# and #" & Format$(PrintDialog.caleinde.Text, "mm/dd/yyyy") & "# "

    This piece of code i use to get all the info about sales from an access database.

    I give an example to explain:
    on thursday you sell 3 packets of cigarets and 2 patotoes
    on friday you sell 2 packets of cigarets and 3 bottles wine

    Normaly the output of my report must be

    5 packets of cigarets
    2 patatoes
    3 botles whine

    but the output is as follow

    3 packets of cigaretes
    2 packets of cigaretes
    2 patatoes
    3 bottles wine

    he doesn't count it over several days ...

    Is there anyone who can help me with this problem?

    thx
    Greetz matthias

  2. #2

    Thread Starter
    Lively Member
    Join Date
    Jul 2001
    Location
    Belgium (Bruges)
    Posts
    88
    nobody any ideas?
    Greetz matthias

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width