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
Tags:
Permalink Reply by yuvaraj on December 10, 2011 at 6:31pm Hi this yuvaraj u can use this query SELECT DateName(month,'02/12/2011')
Permalink Reply by Akbar Basha on December 10, 2011 at 8:23pm hi Yuvaraj,
thanks for replying
but date"02/12/2011" is static in table, it will change in application
pls advice on that
Permalink Reply by Gehad Zeidan on December 10, 2011 at 6:33pm 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.
Permalink Reply by Akbar Basha on December 10, 2011 at 8:23pm hi Zeidan,
thanks for replying
but date"@MonthNumber" is static in table, it will change in application
pls advice on that
Permalink Reply by Gehad Zeidan on December 11, 2011 at 8:00pm 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
© 2012 Created by Quality Testing.