For -healing- a rash you want to use a cream. Use the cream first with clean skin and rub it in fully. This gets absorbed deeper into the skin to help heal damage that's already there. It will NOT last all night, but it will heal faster you after the fact.
For -protecting- against a rash you want to use an ointment. Apply a thin coating on your skin to create a sort of barrier. This WILL last all night, but will not help you very much for healing.
To be truly effective you need to use both methods. For you, I'd say start with just the ointment at night. When you wake up and get cleaned up, use the cream to help heal any rash damage that's been done.