PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 08/03/2017 10:29 AM by  John Henley
UTC Conversions on Date Range Functions
 1 Replies
Sort:
You are not authorized to post a reply.
Author Messages
Joan Herzfeldt
System Analyst
Genesis Health System
Veteran Member
(134 points)
Veteran Member
Posts:50


Send Message:

--
07/31/2017 2:59 PM
    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
    Tags: UTC, ShiftDateTime, Date Range Function
    John Henley
    Private
    Private
    Senior Member
    (9563 points)
    Senior Member
    Posts:3205


    Send Message:

    --
    08/03/2017 10:29 AM
    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.com/cutli...nefit.htm.
    Thanks for using the LawsonGuru.com forums!
    John
    You are not authorized to post a reply.