Listing 1: The Named Query to drive the mining models SELECT DATEPART(d, DrawDate) AS Day_of_Month, DATENAME(m, DrawDate) AS MonthName, DATEPART(w, DrawDate) AS WeekPart, DATEPART(yyyy,DrawDate) AS YearPart, DrawDate, N1, N2, N3, N4, N5, N6 FROM lottery_load