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

Datediff needs to deliver month AND days
with datediff all I can get it to return is months or a total of the
days...

so if the difference in dates is 12 months 4 days how do I adjust the
SQL to accommodate both?


Report this thread to moderator Post Follow-up to this message
Old Post
thrilled
08-27-05 01:23 AM


Re: Datediff needs to deliver month AND days
thrilled  wrote:
> with datediff all I can get it to return is months or a total of the
> days...
>
> so if the difference in dates is 12 months 4 days how do I adjust the
> SQL to accommodate both?

So in February/March you want to return 1 month 2 days some years
and 1 month 1 day every fourth?

You'll need to write it yourself.
--
Daniel A. Morgan
http://www.psoug.org
damorgan@x.washington.edu
(replace x with u to respond)

Report this thread to moderator Post Follow-up to this message
Old Post
DA Morgan
08-27-05 01:23 AM


Re: Datediff needs to deliver month AND days
you're the best


Report this thread to moderator Post Follow-up to this message
Old Post
thrilled
08-27-05 01:23 AM


Re: Datediff needs to deliver month AND days
thrilled (decramer@cox.net)  writes:
> with datediff all I can get it to return is months or a total of the
> days...
>
> so if the difference in dates is 12 months 4 days how do I adjust the
> SQL to accommodate both?

As DA Morgan pointed out, the question needs further clarification.
For instance, how many months + days are there from 2005-08-27 to
2005-04-03? From 2004-02-27 to 2005-09-03?



--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp


Report this thread to moderator Post Follow-up to this message
Old Post
Erland Sommarskog
08-27-05 01: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 12:02 PM.

 
Mobile devices forum | Database support forum archive




Copyrights DropTable.com Database Support Forum 2004 - 2006