In the code below entered_dt is int(4) and looks like 20110217I want to grab the current date and convert it to the same format. When I run the code below I get:Incorrect syntax near the keyword 'group'.SELECT distinct(dbo.oeordlin_sql.prod_cat), dbo.oeordhdr_sql.ord_noFROM dbo.oeordhdr_sql INNER JOIN dbo.oeordlin_sql ON dbo.oeordhdr_sql.ord_type = dbo.oeordlin_sql.ord_type AND dbo.oeordhdr_sql.ord_no = dbo.oeordlin_sql.ord_noWHERE (dbo.oeordhdr_sql.entered_dt = (select convert(char(8), getdate(),112)) AND (dbo.oeordhdr_sql.ord_type = 'O')group by dbo.oeordhdr_sql.ord_no, oeordlin_sql.prod_catORDER BY dbo.oeordhdr_sql.ord_no, dbo.oeordlin_sql.prod_cat