I want to display column called SampleDate from table SampleTable where column SampleAgencyName = something and below the date I want to display the value of a column called SampleNumber.
I mean the results should be something like this.
<tr>
<td>
Date1
SampleNumber1
</td>
<td>
Date2
SampleNumber2
</td>
</tr>
I want to do this using FOR XML Path Root in SQL SERVER.
I can get just the dates to work easily.
SELECT SampleDate 'td' from SampleTable T where SampleAgencyName = 'something' for xml path('tr'), root('table')
My issue how to get the value for the SampleNumber column under the date.