A meaningful day format and 42-day rule

Hi there, forum members

A temporary table is used to store data that the SAM system receives from Active Directory. An XML is used to filter the data, and the number of users is displayed. This section of the code is shared below.

COUNT(*) AS quantity
FROM   tmp_csv2table_aduser
WHERE col_useraccountcontrol NOT IN ('123')

The goal now is to filter the data of users who have logged into the system within the last 42 days using this filtered information. Data in the lastLogonTimestamp format is 133084919288912437.

The 42-day rule will then be used after converting the data from this format into a meaningful day format. On the internet, there are some examples of convert large int to date/time, but they don’t work.

We would be really thankful for any responses from people who have information or experience in this area.

Mustafa

1 Like

Interesting problem, from what I read seems one must convert the 18 character string that is in Nano seconds first by doing a lot of math then convert to date format that is human readable.

While I can’t directly contribute I found a resource that uses SQL which might help.

Keep us posted if you resolve

1 Like