Below is what I currently have for my statement. I'm looking for a way to have data for 5 days each in its own column. I've never done a script like this. See below for what I want. I was thinking a case statement but that will for me to put the print_date which will cause issues showing location_id more then once as I only want one row for each location_id.
SELECT company_id, location_id, COUNT(pick_ticket_no) AS pt_count_day1
WHERE (delete_flag = 'n') and (print_date BETWEEN GETDATE() - 1 AND GETDATE() - 0)
GROUP BY company_id, location_id
ORDER BY location_id
Thank and let me know if you need more info!