User Profile

Collapse

Profile Sidebar

Collapse
preek
preek
Last Activity: Oct 2 '08, 08:49 AM
Joined: Aug 28 '08
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • preek
    replied to Cumulating data
    Wow, this is real magic happening(;

    No, seriously - thank you very much; I wouldn't have come up with the idea, but it works like a charm and now after I've seen how it can be done.. of course I feel stupid, like all the time when something like that happens*g*

    Anyway; you made my day - now I don't have to cumulate the data in a cronjob, just to work around my unworthy MSSQL skills..

    Thanks again and have...
    See more | Go to post

    Leave a comment:


  • preek
    started a topic Cumulating data

    Cumulating data

    Hi there,

    The following statement cumulates all scanned invoices from a given day:

    "SELECT CONVERT(char(10 ), SCANDATE, 102) AS Scandate, COUNT(CONVERT(c har(10), SCANDATE, 102)) AS Number_of_scann ed_invoices
    FROM invoices
    WHERE (Scandate IS NOT NULL) AND
    (Scandate BETWEEN '" + from + "' AND '" + until_ +
    "') GROUP BY CONVERT(char(10 ), SCANDATE,...
    See more | Go to post

  • preek
    replied to unique values combined with COUNT()
    I have found my solution; I actually did use MIN() as suggested:

    SELECT CREDITOR_NAME, CREDITOR_NO, MIN(INV_ID), COUNT(CREDITOR_ NO) as no_of_inv
    FROM DIPPMX.ADMIN.TI $ST_RECO
    GROUP BY CREDITOR_NAME, CREDITOR_NO
    HAVING COUNT(CREDITOR_ NO) >= 3
    See more | Go to post

    Leave a comment:


  • preek
    started a topic unique values combined with COUNT()

    unique values combined with COUNT()

    Hi there,

    The following statement produces multiple results, but I only need one.

    SELECT CREDITOR_NAME, CREDITOR_NO, INV_ID, TRAIN_COUNT, COUNT(CREDITOR_ NO) as number_of_inv
    FROM DIPPMX.ADMIN.TI $ST_RECO
    GROUP BY CREDITOR_NAME, INV_ID, TRAIN_COUNT, CREDITOR_NO
    HAVING COUNT(CREDITOR_ NO) >= 5

    Normally I would include the CREDITOR_NAME...
    See more | Go to post
    Last edited by preek; Aug 28 '08, 04:19 PM. Reason: insufficient title
No activity results to display
Show More
Working...