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
 General SQL Server Forums
 New to SQL Server Programming
 I need to find.

Author  Topic 

MageshkumarM
Yak Posting Veteran

61 Posts

Posted - 2011-01-21 : 04:13:38
hi guys,

I need one query, could pls solve this


Data:-

FdS_P_SEC_ID ---- DATE ----- FYE ---- MV_USD --- PE
BN7M-S-CH-- 2010-01-01-- 2010-03-31-- 44814.7 91.48064
BN7M-S-CH-- 2010-01-01-- 2010-06-30-- 44814.7 67.68122
BN7M-S-CH-- 2010-01-01-- 2010-09-30-- 44814.7 55.13476
BN7M-S-CH-- 2010-01-04-- 2010-09-30-- 45771.2 56.31152
BN7M-S-CH-- 2010-01-04-- 2010-03-31-- 45771.2 93.43315
BN7M-S-CH-- 2010-01-04-- 2010-06-30-- 45771.2 69.12578
BN7M-S-CH-- 2010-01-05-- 2010-06-30-- 45850 69.24478
BN7M-S-CH-- 2010-01-05-- 2010-03-31-- 45850 93.59401
BN7M-S-CH-- 2010-01-05-- 2010-09-30-- 45850 56.40847
BN7M-S-CH-- 2010-01-06-- 2010-09-30-- 46255.3 56.9071
BN7M-S-CH-- 2010-01-06-- 2010-03-31-- 46255.3 94.42135
BN7M-S-CH-- 2010-01-06-- 2010-06-30-- 46255.3 69.85689
BN7M-S-CH-- 2010-01-07-- 2010-06-30-- 46746.5 70.59872
BN7M-S-CH-- 2010-01-07-- 2010-03-31-- 46746.5 95.42404
BN7M-S-CH-- 2010-01-07-- 2010-09-30-- 46746.5 57.51142
BN7M-S-CH-- 2010-01-08-- 2010-09-30-- 47392.7 58.30643



i hav data like this. i need to find the date between the fye date.


Output:-

2010-01-01-- 2010-03-31
2010-01-02-- 2010-03-31
2010-02-01-- 2010-03-31
2010-03-01-- 2010-03-31
2010-03-02-- 2010-03-31
2010-04-01-- 2010-06-31
2010-04-02-- 2010-06-31
2010-05-01-- 2010-06-31
2010-05-02-- 2010-06-31
2010-07-01-- 2010-09-30
2010-07-01-- 2010-09-31

so I need to calculate a value between the fye date range,

for example
(Date between 2010-01-01 and 2010-03-31)

give it in single statement..


suggestion welcome,





MAG,
Start with the new Idea..
http://mageshkumarm.blogspot.com/

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-01-24 : 10:46:51
sorry not clear. probably you could explain how you arrived at that output

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

Go to Top of Page
   

- Advertisement -