Drop Table

Support Forum for database administrators and web based access to important newsgroups related to databases
Register on Database Support Forum Edit your profileCalendarFind other Database Support forum membersFrequently Asked QuestionsSearch this forum -> 
For Database admins: Free Database-related Magazines Now Free shipping to Texas


Post New Thread










Thread
Author

Last Year Month to Date Function
I have been spoiled by some report writing tools that have intrinsic
functions like Last Year Month-to-date. I'm looking for a way to emulate
this in SQL Server now with my fields that are date/time.

I'm thinking I need to develop a user defined function to accept a date
input parameter, but I don't know where to start.

Help/Examples appreciated.

Thanks,
Frank


*** Sent via Developersdex http://www.droptable.com ***

Report this thread to moderator Post Follow-up to this message
Old Post
Frank Bishop
02-16-06 08:24 AM


Re: Last Year Month to Date Function
Hi, Frank

If you have a date and you want to obtain the corresponding date in the
previous year, you can use the DATEADD function, like this:
DATEADD(year, -1, @TheDate). For more informations, see:
http://msdn.microsoft.com/library/e..._fa-fz_2c1f.asp

Razvan


Report this thread to moderator Post Follow-up to this message
Old Post
Razvan Socol
02-16-06 08:24 AM


Sponsored Links





Last Thread Next Thread
Post New Thread

Microsoft SQL Server forum archive

Show a Printable Version Email This Page to Someone! Receive updates to this thread
Microsoft SQL Server
Access database support
PostgreSQL Replication
SQL Server ODBC
FoxPro Support
PostgreSQL pgAdmin
SQL Server Clustering
MySQL ODBC
Web Applications with dBASE
SQL Server CE
MySQL++
Sybase Database Support
MS SQL Full Text Search
PostgreSQL Administration
SQL Anywhere support
DB2 UDB Database
Paradox Database Support
Filemaker Database
Berkley DB
SQL 2000/2000i database
ASE Database
Forum Jump:
All times are GMT. The time now is 05:42 AM.

 
Mobile devices forum | Database support forum archive




Copyrights DropTable.com Database Support Forum 2004 - 2006