hi guys i have this code,,
but the code is error coz i use the While function when selecting a data,,Code:declare @n int set @n = 1 SELECT TOP 100 PERCENT ID, purchase_id, supp_add_mat_id, mat_code, asset_no, qty, require_by, require_date, require_desc, status, pr_detail_asset, scheduled, while @n <= 31 begin CASE WHEN datepart(day, require_date) = @n THEN qty ELSE '0' END AS @n set @n = @n+1 end FROM dbo.t_pr_details
plz help..![]()




Reply With Quote