Exforsys

Online Training

Help me with this query

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 ...


Go Back   Exforsys > Database > Sybase

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 12-05-2007, 02:49 PM
Junior Member
 
Join Date: Dec 2006
Posts: 5
nagivijay is on a distinguished road
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'
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools

Posting Rules
You may not post new questions
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads

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


All times are GMT -4. The time now is 04:44 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0
Copyright 2004 - 2007 Exforsys Inc. All rights reserved.