I found some code on line, see below, and changed it to meet my needs but when I run it I get:
Due Date undefined
This is the only value in the list, but it should look like:
Due Date 01/31/2019
Below is the code. Also I'm not a coder, so if you answer please show me what to correct.
<table width="70%" align="left" id="myHTMLTable" border="1">
<tbody>
<tr align="left">
<td>
<b>DueDate</b></td>
</tr>
<tr align="middle">
<td align="left">undefined</td>
</tr>
</tbody>
</table>
<script type="text/javascript">
getMyListData() ;
function getMyListData()
{
var method = "GetListItems";
var webURL = $().SPServices.SPGetCurrentSite() ;
var list = "Project Statement";
var fieldsToRead = "<ViewFields>"+"<FieldRef Name='Name' />" +"</ViewFields>";
var query = "<Query><OrderBy><FieldRef Name='Due-Date' /></OrderBy></Query>";
$().SPServices
({
operation: method,
async: false,
webURL: webURL,
listName: list,
CAMLViewFields: "<ViewFields Properties='True' />",
CAMLQuery: query,
completefunc: function (xData, Status)
{
$(xData.responseXML).SPFilterNode("z:row").each(function()
{
var vDueDate = $(this).attr("ows_Due-Date");
$("#myHTMLTable").append("<tr align='middle'>" +
"<td align='left'>"+vDueDate+"</td>" +
"</tr>");
});
}
});
};
</script>