Forum Discussion

RMDNA's avatar
RMDNA
Icon for Solution Sage rankSolution Sage
9 years ago

DateTime.LocalNow to number conversion

Hi all,

 

I have a table in my report that contains "DateTime.Date(DateTime.LocalNow())" in order to provide a "last refreshed on:" card. What I'd like to do, for a forecasting piece, is only display events after that date.

 

Our event dates are structured as a whole number in the format "20170323," while DateTime returns a date "3/23/2017," so I need the refresh date as a number in order to filter by "greater than." 

 

When I attempt to convert the date to a whole number data type, it changes to (using the above date) 42817. Any tips?

15 Replies

      • RMDNA's avatar
        RMDNA
        Icon for Solution Sage rankSolution Sage

        The end goal is to get the date in "whole number" format. I'm able to get the date as text, but I can't change it from there.

         

        "3/24/2017" (DateTime) to "20170324" (Whole Number) - it breaks, returns as "42817"

         

        "3/24/2017" (DateTime) to "3/24/2017" (Text) - success

                      "3/24/2017" (Text) to "20170324" (Whole Number) - "cannot change type"