I had a chick (4-5 weeks old) do this. She was all bones and slept all the time, so I separated her. If the poop is green, they haven't eaten in a while, so watch out for that.
When it got really bad I got a syringe and put crushed food and water in it and forced her to eat little bites by placing some of the thick mixture in her mouth. It was a messy job because she would fling some out, but some food got in and that's all I needed. After a week or so, she began eating on her own again and was released back in the flock.
I found that dropping some of the food on the back of her beak opening made her open it and eat. Make sure if you do this that you don't get any water/wet food up their nostrils.
I have no idea what caused this, but she did pull through. Is your bird stressed in any new way? This happened to me a few weeks after a new introduction to the flock. Good luck with your quail!