Alcohol, Prescriptions, Drugs before you know you're pregnant?

What are the consequences for the baby if you've had alcohol, weed, or were on Percocet and Tramadol prescriptions before you knew you were pregnant? I mean like essentially before 4 weeks of pregnancy.