473,320 Members | 1,857 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Query help

Hi,
I have to write a query. where I need, to utilize the Case Status field and see within the time period of the query(month) when a case status goes from Closed to Active for particular caseID


CASE ID DATE STATUS
ABC 2-Jun ACTIVE
DSA 4-Jun ACTIVE
EDD 4-Jun CLOSED
QDK 3-May ACTIVE
ASD 2-May CLOSED
ABC 4-Jun CLOSED
DAJ 4-Feb ACTIVE
FKD 5-Feb CLOSED
ABC 10-Jun ACTIVE

Here in the above table, Case ID ABC has 3 records in the month of june which started with active(2/june) and
was closed on (4/june) and again was made active on (10/june), I have to get the count of the case ID of cases which goes from closed to active just using a SQL Query(No Stored Procs)


Thanks in advance.
Jul 2 '10 #1
1 1707
OraMaster
135 100+
@northwest
Hope it will help.

Expand|Select|Wrap|Line Numbers
  1. SELECT   caseid, status, TO_CHAR (casedt, 'MON'), COUNT (*)
  2.     FROM sqlhelp
  3.    WHERE UPPER (status) = 'ACTIVE'
  4. GROUP BY caseid, status, TO_CHAR (casedt, 'MON')
  5.   HAVING COUNT (*) > 1
Jul 6 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Xenophobe | last post by:
I know this isn't a MySQL forum, but my question is related to a PHP project. I have two tables. table1 table2 "table1" contains 2 columns, ID and FirstName:
14
by: Bruce W...1 | last post by:
I do a query to MySQL using PHP. Well actually I do too many of them which is the problem, it's too slow. I think maybe an inner join or something would be better but I can't figure this out. ...
1
by: Hought, Todd | last post by:
Hi all, trying to run a query against a table, to pull the date out, and order it. problem is, the date is stored in character (string) format, not as an actual timestamp, so parsing it back into...
1
by: PMB | last post by:
Thank you in advance for any and all assistance. I'm trying to use a make table query to pull the last transactionID, so I can use an append query to reset the transactionID to the next...
5
by: Norma | last post by:
I am trying to make a query pull data from between the dates I enter in the parameter but also look back 'in time' to see where 2 other fields have null values, and only pull data into the query if...
10
by: Randy Harris | last post by:
I imported records into a table, later found out that many of them had trailing spaces in one of the fields. If I'd caught it sooner, I could have trimmed the spaces before the import. This...
2
by: schoultzy | last post by:
Hello Everyone, This is probably a simple fix so be kind when/if you reply. The query below retrieves information for individuals based on a column named ATTRIB_DEF, and assorted other columns;...
6
by: leeg | last post by:
Help please. Apologies but I am poor in access and programming :o) and am having trouble getting my head around this one!!...again!!! I need to have a query or report to flag up someone who has...
1
by: write2ashokkumar | last post by:
hi... i have the table like this, Table Name : sample Total Records : 500000 (Consider like this) Sample Records: ----------------
1
by: write2ashokkumar | last post by:
hi... i have the table like this, Table Name : sample Total Records : 500000 (Consider like this) Sample Records: ----------------
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.