Quality Testing

Quality is delighting customers

Hi Al,l

In Sql Server Db2005
record is like give below
                        
Column    -    Year    Month    Number of day    Hospital Name         Address
Value    -      2010    12                    12            Ramana Hospital     test test test

In UI month value is display as December

I have to write query for this Month value instead of 12 i have to display December

pls advice me with query.

Regards,

Akbar

Views: 216

Reply to This

Replies to This Discussion

Hi  this yuvaraj u can use this query   SELECT DateName(month,'02/12/2011')

hi Yuvaraj,

thanks for replying

but date"02/12/2011" is static in table, it will change in application

pls advice on that

Hi akbar

I think a query like this should make the work
Select DateName( month , DateAdd( month , @MonthNumber , 0 ) - 1 )
will you please inform me if it worked or not. thank you.

hi Zeidan,

thanks for replying

but date"@MonthNumber" is static in table, it will change in application

pls advice on that

my advice is

To select the value from the database and place it in a variable and use that variable in the conversion statement. by this you will have a dynamic select statements for a static value. What do you think. I believe this is better than writing a fixed value

RSS

TTWT Magazine


Advertisement

Advertisement

Advertisement

Advertisement

© 2019   Created by Quality Testing.   Powered by

Badges  |  Report an Issue  |  Terms of Service