I need to calculate the LastLoginDate - Created Date of Users in a formula field. The Last Login Date field is not available here.. Is there a way to get it without having to write code/SOQL?
You can't access the Last Login Date in the formula, but the field is assessible via APEX and Visual Flow.
If you're in the headless Flow pilot - or when it goes GA - you can do this without code. You'll have two options, create the flow which saves the Last Login Date in a custom date field for your formula - or do the calculation directly in the flow and save it.
If you are not in the pilot, you can call the flow via an Apex Trigger. The code is fairly simple and would save you from having to write all the logic in Apex.