public string Compile(IGroupByColumn value, SelectQuery query, IQueryParameterManager parameters) { var select = value as GroupByColumn; return(string.Format("{0}{1}{2}", select.TableAlias, string.IsNullOrWhiteSpace(select.TableAlias) ? null : ".", select.Field.Name )); }
public string Compile(IGroupByColumn value, SelectQuery query, IQueryParameterManager parameters) { var select = value as GroupByColumnDatePart; var format = "DATEADD({0},0, DATEDIFF({0},0, {1}{2}{3}))"; return(string.Format(format, select.DatePart.ToSqlString(), select.TableAlias, string.IsNullOrWhiteSpace(select.TableAlias) ? null : ".", select.Field.Name )); }