Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Find the month status
Message
De
11/09/2007 13:25:01
Issam Mansour
Jordan Business Machines
Amman, Jordanie
 
 
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Versions des environnements
SQL Server:
SQL Server 2005
Divers
Thread ID:
01253723
Message ID:
01253729
Vues:
23
the columns is logical, the field name is mon_1,Mon_2 ans so on.
each row have a year number to show the year belong.

the following statement i tryed but dose not works:-

SELECT [year],
NULLIF(CHARINDEX('F', CAST(mon_1 AS CHAR(1)) + CAST(mon_2 AS CHAR(1)) + CAST(mon_3 AS CHAR(1)) + CAST(mon_4 AS CHAR(1)) + CAST(mon_5 AS CHAR(1)) + CAST(mon_6 AS CHAR(1)) + CAST(mon_7 AS CHAR(1)) + CAST(mon_8 AS CHAR(1)) + CAST(mon_9 AS CHAR(1)) + CAST(mon_10 AS CHAR(1)) + CAST(mon_11 AS CHAR(1)) + CAST(mon_12 AS CHAR(1))) - 1, -1)
FROM mumonth

the result i get as follows

2004 null
2005 null
2006 null
2007 null
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform