Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How can I fill a grid with monthly figures?
Message
De
18/01/2002 09:14:41
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
18/01/2002 09:07:17
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00606622
Message ID:
00606668
Vues:
31
This message has been marked as the solution to the initial question of the thread.
>Perfecto! Sólo que ahora la columna mes, me muestra un número integral. Cómo hago para que me muestre Mes-Año?
>Gracias por anticipado
>Ulises

You supuse que querías ordenar por año, luego por mes.

La función dtos() te convierte una fecha en un string apropiado para indexar u ordenar: aaaa-mm-dd (sin los guiones).

La expresión left(dtos(fecha),6) permite discriminar por año y mes (¡de otra manera, si sólo se discrimina el mes, "Enero 2000" = "Enero 2001"!), y lo ordena correctamente.

Otra opción (y más fácil para mostrar mes y año en grid o informe) es:
SELECT sum(Valor) as Total, month(fecha) as mes, year(fecha) as ano;
  GROUP BY mes, ano
Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform