In a saucepan, combine the pineapple and sugar. Bring to a boil, then cook over medium heat, stirring constantly, until thickened, 5 to 10 minutes. Remove from the heat and cool. When cool, stir in the walnuts.
In a medium bowl, stir cream cheese to soften, then stir in enough milk to make it easy to spread. Blend in the pineapple mixture. This part can be made the day before if you like.
Spread about 2 tablespoons of the pineapple mixture onto one side of 12 slices of bread. Top each one of these with 5 thin slices of ham. Top with remaining bread slices.