I am quering a db2/400 data base and inserting into a temp table.The table (which is a JDEdwards table) contains a date field that is numeric 6.0 (this is jde standard). Example format: 107299 where 107 equates to year 2007 and 299 is the day withing the year. I've been trying to cast this field into a datetime field without success. For year I think you can add 1900 and get the correct year (107 + 1900 = 2007). Not sure about the day of year. Anyone able to give me assistance?The field in question is: vcdgjcreate table #JDE_DisbursementTable ( jde_bol_number int, jde_trans_date datetime, jde_product_code char(10), jde_product_name char(30), jde_gross_qty dec(15,2), jde_net_qty dec(15,2) )insert into #JDE_DisbursementTable(jde_bol_number, jde_trans_date, jde_product_code, jde_product_name, jde_gross_qty, jde_net_qty)select vcdoc, vcdgj, vcprd1, vcpnam, cast(vcqty as decimal(15,2)), cast(vcnetg as decimal (15,2)) from AS400SRV_IBMDA400.VGSYS400.VGITFRLIB.F55124where vcpltc = @Terminal and @Product = Null or vcprd1 = @Product and @JdeDateFrom = 0 or vcdgj >= @JdeDateFrom and @JdeDateTo = 0 or vcdgj <= @JdeDateTo