UTC Conversions on Date Range Functions

Author
Messages
Joan Herzfeldt
Veteran Member
Posts: 74
Veteran Member
    I'm accessing a database that has dates stored in UTC so even though 'an action was taken' on 6/30/2017 20:12:00 Central time (where I'm located) , due to the conversion to UTC this record does not show up on the report if I use " in the LastFullMonth" because it converts to 7/1/2017 01:12:00 UTC. I know how to replace LastFullMonth with two separate date parameters. What I want to know is... Is there a way to convert any of the 'Date Range Functions' (ie: LastFullMonth) to take the time zone into consideration? Similar to how ShiftDateTime() works on a single date?
    FYI: We are looking for solution to correct multiple reports, not just one.
    Thanks - Joan
    John Henley
    Senior Member
    Posts: 3348
    Senior Member
      It depends on your database, and how you're accessing the data. If you're using custom coding the data via stored procedures, views, or SQL commands, you can include that decoding within the SQL that is populating the data. In other words, return both the true UTC date/time stamp and the local date/time stamp, and filter in the report, or pass the local time zone and start/end dates as parameters to the backed database and select in the database SQL. It sounds like you're accessing IBM DB2 tables via Crystal, so you can use a SQL expression field (faster since evaluation is done on the server, but specific to the database, and gives you access to the backed database functions). You can also code it in a formula (see special fields for data time zone and print time zone) and do the filtering in record selection (which is slower than SQL expressions since evaluation is done within the report). Lastly, you can also explore custom functions that plugs into Crystal such as CUT: http://www.milletsoftware...cutlightBenefit.htm.
      Thanks for using the LawsonGuru.com forums!
      John
      ---