Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recent content by damonkimble

  1. damonkimble

    Errors sending command parameter to UDF

    FYI, it had to do with the fact that UDFs cannot deal with non-deterministic functions (e.g. getdate()). I had to declare a variable, set the variable to the value of the parameter and sent the variable to the UDF. this works!: declare @dt datetime set @dt = {?dt} select list_date from...
  2. damonkimble

    Errors sending command parameter to UDF

    Crystal 10 connecting to MSSQL 2000 (sp3a) via ODBC (MDAC 2.8) I am attempting to send command parameters to a UDF but keep getting a rowset error. I start out with hardcoded dates and after confirming the query works in the command, added parameters and replaced the hardcoded dates. The UDF...
  3. damonkimble

    Grand Total does not match details

    Data that is filtered out by the select expert will not show up in any totals. Please supply CR version, db and connection info. Please supply a specific example or two of the formulas involved. Also describe any grouping and suppression. damon
  4. damonkimble

    Closest to date

    If you are using a command, you can write the query to have a max(date_field) <= your date parameter (current or otherwise). Your date parameter would have to be a command parameter. If you aren't using a command, you could order by date desc and suppress everything other than the first...
  5. damonkimble

    Date Value result

    How will these 12 displays be laid out when complete? Is there a way to send a variable to offset? damon
  6. damonkimble

    Date formula to first of next month

    Ah yes, LB is correct too. I forgot about the relative functionality of dateserial. damon
  7. damonkimble

    Date Value result

    I'm not completely following you, but I think this is what you are looking for. As you said you are using this multiple times, easist to use custom function. To make it more generic I added the datetime as a variable too. Function (DateTimeVar dt, NumberVar offset) // takes in datetime and...
  8. damonkimble

    Date formula to first of next month

    A combination of dateserial and dateadd should do the trick. You're taking the year and month of the given date plus one month and 1 for the day value. cheers, damon dateserial(year(dateadd('m', 1, {table.datefield})) ,month(dateadd('m', 1, {table.datefield})) ,1)
  9. damonkimble

    Remove Time from DateTime field

    If you are trying to print a single field, just right click Format Field. You can choose from a variety of date and/or time combinations. As far as age goes, it is surprising that there still isn't a good built-in function. Here is a custom function I made. Function (DateTimeVar dstart...
  10. damonkimble

    Grouping by 30 Minute intervals

    Grouping on this more generic formula should do the trick. damon truncate((hour({table.datefield}) * 60 + minute({table.datefield}))/30)
  11. damonkimble

    Financial Date Selection

    As Madawc suggests, a formula rather than an array is the way to go. What is the criterea for your financial periods? damon
  12. damonkimble

    Grouping issues

    FYI, I ended up using subreports as it ended up being less complex than using arrays. Also, I'm using a command parameter to choose the person, so it limits the scope of how many times the subreports are done. Thanks to Synapse for the array idea, even though I didn't end up using it. damon
  13. damonkimble

    Increment Date Value

    I'm missing how your two start and end dates should return four date values. Also, what was your formula that used dateadd and what were the results? damon
  14. damonkimble

    Formula to pull Maximum of DateTime field

    Please note above is assuming that it is a date field, not a datetime. damon
  15. damonkimble

    Formula to pull Maximum of DateTime field

    Go to select expert -> show formula -> formula editor: {JOB_STEP_EMP_PROD_RATE.JOB_STEP_EMP_PROD_RATE_DATE} = Maximum({JOB_STEP_EMP_PROD_RATE.JOB_STEP_EMP_PROD_RATE_DATE}) Assuming there is nothing else there, adding the above should do the trick. cheers, damon

Part and Inventory Search

Back
Top