Prepare for your Next Interview
This is a discussion on To get previous month names within the SQL Server forums, part of the Databases category; How can i get last there previous month names by useing system date...
|
|||
|
Re: To get previous month names
Will that work in SQL server ?
|
|
|||
|
Re: To get previous month names
I got the answer for question
select datename(month, dateadd("month",-1,getdate())), datename(month, dateadd("month",-2,getdate())), datename(month, dateadd("month",-3,getdate())) |
|
|||
|
Re: To get previous month names
Sorry boreddy u cant use month is quotes.
Use select datename(month, dateadd(month,-1,getdate())), datename(month, dateadd(month,-2,getdate())),datename(month, dateadd(month,-3,getdate())) |
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| To read the previous record from the last | farhana | MainFrame | 0 | 12-13-2007 02:51 AM |
| Find previous executed SQL | pande.dhiraj | SQL | 3 | 11-20-2007 04:16 AM |
| I want to get the previous row from a table | divya_rad | SQL | 7 | 07-25-2007 03:56 AM |
| Latest and previous versions of LR, Winrunner and QC | karthik.dr | WinRunner | 0 | 06-06-2007 12:51 AM |
| find current and previous profession... | psuresh1982 | Brainteasers | 21 | 01-08-2007 05:55 AM |