I'm trying to pivot column values to column names, and populate their fields with the most recent date in the DueDate field. The code I have is returning NULL for every field. I'm not a DBA, but I need to get this done. My code is below. Thanks!
SQL
selectPatientGUID,Bordetella,[CanineDistemper],Rabiesfrom(selectPatientGUID,ReminderName,DueDatefromdbo.idvPatientReminders)dpivot(max(DueDate)forReminderNamein(Bordetella,[CanineDistemper],Rabies))piv;