Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Find the month status
Message
From
11/09/2007 13:25:01
Issam Mansour
Jordan Business Machines
Amman, Jordan
 
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Environment versions
SQL Server:
SQL Server 2005
Miscellaneous
Thread ID:
01253723
Message ID:
01253729
Views:
24
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform