So I’ve got a script to pull a record set and display it in html format, and it pulls everything in the set.
How do I pull [I]only the records for unique zip codes
Any help would be greatly appreciated. Here’s the script:
[code]
function zipCodeStudyRecords() {
// Variable Declarations
var firstName;
var lastName;
var gender;
var zipCode;
var outputTable;
var records;
var count = 0;
var allDisplayRows = “”;
// Get the HTML output table so we can add rows
outputTable = document.getElementById(‘outputTable’);
// Open the Zip Code Study Records and make them
// available to the script
records = openZipCodeStudyRecordSet();
while (records.readNextRecord()) {
if (count >= 25) {
break;
}
firstName = records.getSampleFirstName();
lastName = records.getSampleLastName();
gender = records.getSampleGender();
zipCode = records.getSampleZipCode();
allDisplayRows += “<tr><td>” + firstName + “</td>”
+ “<td>” + lastName + “</td><td>” + gender
+ “</td><td>” + zipCode + “</td></tr>”;
count++;
}
// Output the entire data table
outputTable.innerHTML = allDisplayRows;
}