This is a discussion on Help me with this query within the Sybase forums, part of the Database category; I have to create a report that will return up to 25 examples of each scenario explained below A. If ...
|
|||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Help me with this query
I have to create a report that will return up to 25 examples of each scenario explained below
A. If Cert_no is on current active group Billing Unit for the last load date, use the current active WID on Cards Code to display the following: i. If only one active coverage found as of the last load date and WID on Cards Code = “E” ii. If only one active coverage found as of the last load date and WID on Cards Code not “E” iii. If more than one active coverage found as of the last load date and WID on Cards Code = “E” iv. If more than one active coverage found as of the last load date and WID on Cards Code not = “E” V. IF more than one active coverage found as of the last load date and there is a mix of WID on Cards Code = “E” and WID on Cards Code not = “E” i have written the following queiry, however i need to find out a way to check all the above scenarios in one script - i might have to set higherarchies to get top 25 examples of each scenario The number or description of the DBR must also be indicated. Note- if the cycle date is between current and expiration then the coverage is active (1/1/2007-12/31/2007) if the cycle date is not between current and expiration then the coverage not actvie (1/1/2006 -12/31/2006) -------------------------------------- CREATE VARIABLE cycle_dt DATE; SET cycle_dt = (SELECT cycle_date from dba.cycle_date); select a.cert_num, b.wellmark_id, b.employee_id, b.id_card_num from dba.mbr_benefit_dim as a, dba.certificate_number_dimension as b, dba.group_benefit_dim as c where a.wellmark_id=b.wellmark_id and a.cert_num=b.certificate_number and a.Group_Benefit_Dim_Key=c.Group_Benefit_Dim_Key and b.Data_Source_Dimension_KEY=c.Data_Source_Dimension_KEY and cycle_dt between c.effective_date and c.expiration_date and c.wellmark_id_on_cards_flag='E' |
![]() |
| Thread Tools | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to find second max sal of employee with the co | chandraismoon | Oracle Tutorials | 7 | 05-16-2008 03:08 AM |
| Query with Querying Database | rachelle | MySQL | 1 | 05-11-2007 03:41 PM |
| Performance of Query | Ralph | MySQL | 2 | 05-08-2007 04:44 PM |
| SQL QUERY IN REPORTS 6i:Pls help | nitinkoshymech | Oracle Database | 1 | 11-27-2006 09:34 AM |
| how to use the same form for query mode and input mode | bhaskara avunoori | Oracle Apps | 1 | 06-23-2006 06:07 AM |