Is it possible to do a day trip or is it to far?
You can, but I am not sure it is worth a day away from Rome for only Amalfi Town. Take a frecciarossa to Salerno, then catch a bus to Amalfi Town. Total about 3 hours travel time. If you want to see the whole Amalfi Coast, you then have to take the bus north to Sorrento from Amalfi Town, followed by the train to Naples and another high-speed train back to Rome. You won't have time to do much more than sit on buses or trains. You can also do this in reverse.
If you really want to see the A.C., try to carve out at least 3 nights for it.
I agree with Laurel. It's not worth the day trip. Chose quality over quantity. Visit the Amalfi coast on another trip unless you can have an extra 3 days.