Quantcast
Channel: Microsoft SQL Server
Viewing all articles
Browse latest Browse all 4871

Max Date Returning Null for All Date Fields

$
0
0

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;

Viewing all articles
Browse latest Browse all 4871

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>