-- Gestiune si echilibru financiar (VRC, DIC, VRS, VRA, FR, TN, DAD)
SELECT
  DATE_FINANCIARE.AnFinanciar,
  [CifraAfaceriNeta]/[Creante] AS VRC,
  IIf([VRC]>12,"OPTIM",IIf([VRC]>6,"ACCEPTABIL","DEFICITAR")) AS D_VRC,
  360/([CifraAfaceriNeta]/[Creante]) AS DIC,
  IIf([DIC]<30,"OPTIM",IIf([DIC]<60,"ACCEPTABIL","DEFICITAR")) AS D_DIC,
  ([CostMateriePrima]+[AjustarileValoare])/[Stocuri] AS VRS,
  IIf([VRS]>24,"OPTIM",IIf([VRS]>12,"ACCEPTABIL","DEFICITAR")) AS D_VRS,
  [CifraAfaceriNeta]/([ActiveImobilizate]+[ActiveCirculante]) AS VRA,
  IIf([VRA]>1.5,"OPTIM",IIf([VRA]>1,"ACCEPTABIL","DEFICITAR")) AS D_VRA,
  ([CapitaluriProprii]+[DatoriiTermenLung])-[ActiveImobilizate] AS FR,
  IIf([FR]>0,"OPTIM","DEFICITAR") AS D_FR,
  ([CapitaluriProprii]+[DatoriiTermenLung])-[ActiveImobilizate]-(([ActiveCirculante]-[Stocuri])-[DatoriiCurente]) AS TN,
  IIf([TN]>0,"OPTIM","DEFICITAR") AS D_TN,
  ([DatoriiCurente]+[DatoriiTermenLung])/[CifraAfaceriNeta]*365 AS DAD,
  IIf([DAD]<90,"OPTIM",IIf([DAD]<180,"ACCEPTABIL","DEFICITAR")) AS D_DAD
FROM DATE_FINANCIARE;
