Select y.y Monat , Ceiling(y.y/3.0) Quartal , y.y - 3*(Ceiling(y.y/3.0) - 1) PositionImQuartal from ( SELECT number FROM master.dbo.spt_values WHERE type='P' AND number>=1 AND number <=12 ) y(y)
Gedanken zu SQL, Reports, ETL und CRM
Select y.y Monat , Ceiling(y.y/3.0) Quartal , y.y - 3*(Ceiling(y.y/3.0) - 1) PositionImQuartal from ( SELECT number FROM master.dbo.spt_values WHERE type='P' AND number>=1 AND number <=12 ) y(y)