try something like:
select pairname, datediff(d, max(date), min(date)), datediff(m, max(date), min(date))
from pairs
group by pairname
Good luck,
Vlad
http://www.logicmagic.com
The user options setting of sp_configure allows server-wide settings and works across multiple databases. This setting also behaves like an explicit SET statement, except that it occurs at login time.
So... Try something like
USE master
EXEC sp_configure 'set dateformat mdy'
RECONFIGURE WITH...
The best way I found to do hierarchies is not to do it by autonumber id but inbed level info into the ID.
So your example would have ids that looked like
1
1_a
1_b
1_b_i
and then you can do
select *
from table
where ID = '1' or ID like '1_%'
I hope you can see how this would allow you to...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.