Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

Variable Date Range if then else statement

edited October 2008 in General
?Hi there
I know there must be something I am missing. I have spent many hours on
formula to try to add a statement based on a date range. I tried all
sorts of methods.

Here is what I am trying to accomplish

I have a datetime value that is DateWorked, I want to group the Date
worked into 2 week intervals. The start date is always the same.

In essence I am trying to group the data in a report summary into
payperiod 1-26. I then want to include a value for each period by Summing
the values for that specific period

I do not need to see any details - I just want the summary

In the end, I would have 26 totals .

Can anyone help? I even tried to add a variable for dateworked and made
it an integer. I can't seem to get the syntax correct.

-Caralene
QHR Software

--- posted by geoForum on http://delphi.newswhat.com

Comments

  • edited October 2008
    Hi Caralene,

    The easiest way to go about this is to keep all the processing in SQL code
    on your database. The key is to be able to group your query by a bi-weekly
    timeframe. Depending on which database you are using, this may be possible.
    Using the DateDiff() function for example or a separate calendar table.

    In Delphi, you will need to find a way to force the report to perhaps break
    to a new group every two weeks, displaying the sum of that group in the
    group footer. This could be done using the various date formatting
    functions provided by Delphi.

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.