Number of days in month : Sql server(sanjevsharma.blogspot.com)

submitted by sanjev.sharmasanjev.sharma(579) 3 years, 10 months ago

declare @month int, @year int, @date datetime select @month = 2, @year = 2000 select @date = convert(varchar, @year) + right('0' + convert(varchar, @month), 2) + '01' select datediff(d, @date, dateadd(m, 1, @date)) as "Number of Days" -- This one determines the last day of the month. -- Uses almost similar logic as the above statement. select dateadd( d, -1 , dateadd( m , 1 , @date ) ) AS "Last Day Of Month"

add a comment |category: |Views: 7

tags: another

new Add a live kick counter to your blog >> liveImage

You can even customize the image by choosing your own colors, and then clicking the button below to update the preview and the html code:

  • "Kick It" text
  • "Kick It" background
  • kick count text
  • kick count background
  • border

Simply copy and paste this HTML into your blog post.


Users who kicked this story:
Comments:

No comments so far

information Login or create an account to comment on this story