month numbers in sql
-
we can get month names by using select datename(mm,getdate()).How to select the month numbers(eg:1,2,3...12) using select statement in sql server?Please suggest the format to select month numbers.
-
we can get month names by using select datename(mm,getdate()).How to select the month numbers(eg:1,2,3...12) using select statement in sql server?Please suggest the format to select month numbers.
You can use datepart to retrieve the month number in SQL Server.
I'm not a stalker, I just know things. Oh by the way, you're out of milk.
Forgive your enemies - it messes with their heads
-
we can get month names by using select datename(mm,getdate()).How to select the month numbers(eg:1,2,3...12) using select statement in sql server?Please suggest the format to select month numbers.
Which database system? Doesn't SQL server use DatePart?
-
we can get month names by using select datename(mm,getdate()).How to select the month numbers(eg:1,2,3...12) using select statement in sql server?Please suggest the format to select month numbers.
In MS SQL server you can use MONTH(mydate)
-
we can get month names by using select datename(mm,getdate()).How to select the month numbers(eg:1,2,3...12) using select statement in sql server?Please suggest the format to select month numbers.
Have your Google powers abandoned you? looking for SQL date functions, you would easily get this page[^] that summarizes it all. :doh:
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
-
we can get month names by using select datename(mm,getdate()).How to select the month numbers(eg:1,2,3...12) using select statement in sql server?Please suggest the format to select month numbers.
you can simply use
select Month(getdate())
to display month in number.