Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 sql spliting queru in SSMS 2008

Author  Topic 

kond.mohan
Posting Yak Master

213 Posts

Posted - 2012-04-11 : 07:54:04

i have used 1 table


here i want find the count of days based on days split into 3 columns


count(datediff(dd,max(fbh.due_Date,fbh.vfd_bod_date))

i need to find the days calculation need to use max(fbh.vfd_bod_date) ,fbh.due_Date column

like

datediff(dd,max(fbh.due_Date,fbh.vfd_bod_date)

here in my sub query i have used having condition

having max(fbh.vfd_bod_date)>fbh.due_date


i want find the datediff between 2 days
one column is direct date
second column is max(fbh.date) column need to fetch


can any body help me on this issue

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-04-12 : 00:53:28
you need to apply group by to get max(date)

thats only suggestion one can give based on information provided

please post some sample data and explain what you want if you need more help

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -