Click here to Skip to main content
15,915,019 members
Home / Discussions / Database
   

Database

 
GeneralRe: Interesting question about a MIN function and usage Pin
James Shao30-Dec-09 12:47
James Shao30-Dec-09 12:47 
GeneralRe: Interesting question about a MIN function and usage Pin
Corporal Agarn31-Dec-09 1:05
professionalCorporal Agarn31-Dec-09 1:05 
QuestionProblem with the french character with sql server 2005 Pin
pranavcool27-Dec-09 18:44
pranavcool27-Dec-09 18:44 
AnswerRe: Problem with the french character with sql server 2005 Pin
Luc Pattyn28-Dec-09 1:33
sitebuilderLuc Pattyn28-Dec-09 1:33 
GeneralRe: Problem with the french character with sql server 2005 Pin
Eddy Vluggen28-Dec-09 2:24
professionalEddy Vluggen28-Dec-09 2:24 
GeneralRe: Problem with the french character with sql server 2005 Pin
Luc Pattyn28-Dec-09 2:33
sitebuilderLuc Pattyn28-Dec-09 2:33 
GeneralRe: Problem with the french character with sql server 2005 Pin
Eddy Vluggen28-Dec-09 2:52
professionalEddy Vluggen28-Dec-09 2:52 
GeneralRe: Problem with the french character with sql server 2005 Pin
Luc Pattyn28-Dec-09 3:09
sitebuilderLuc Pattyn28-Dec-09 3:09 
GeneralRe: Problem with the french character with sql server 2005 Pin
Eddy Vluggen28-Dec-09 6:34
professionalEddy Vluggen28-Dec-09 6:34 
AnswerRe: Problem with the french character with sql server 2005 [modified] Pin
Eddy Vluggen28-Dec-09 2:19
professionalEddy Vluggen28-Dec-09 2:19 
QuestionHelp me understand this unusual query... [modified] Pin
Rafferty Uy27-Dec-09 15:44
Rafferty Uy27-Dec-09 15:44 
AnswerRe: Help me understand this unusual query... Pin
Luc Pattyn28-Dec-09 1:46
sitebuilderLuc Pattyn28-Dec-09 1:46 
QuestionRe: Help me understand this unusual query... Pin
Rafferty Uy28-Dec-09 15:36
Rafferty Uy28-Dec-09 15:36 
AnswerRe: Help me understand this unusual query... Pin
Luc Pattyn28-Dec-09 15:41
sitebuilderLuc Pattyn28-Dec-09 15:41 
QuestionRe: Help me understand this unusual query... Pin
Rafferty Uy28-Dec-09 15:46
Rafferty Uy28-Dec-09 15:46 
AnswerRe: Help me understand this unusual query... Pin
Luc Pattyn28-Dec-09 15:55
sitebuilderLuc Pattyn28-Dec-09 15:55 
GeneralRe: Help me understand this unusual query... Pin
Rafferty Uy28-Dec-09 16:00
Rafferty Uy28-Dec-09 16:00 
GeneralRe: Help me understand this unusual query... Pin
Luc Pattyn28-Dec-09 16:02
sitebuilderLuc Pattyn28-Dec-09 16:02 
AnswerRe: Help me understand this unusual query... Pin
WoutL28-Dec-09 21:24
WoutL28-Dec-09 21:24 
GeneralRe: Help me understand this unusual query... Pin
Rafferty Uy29-Dec-09 15:34
Rafferty Uy29-Dec-09 15:34 
AnswerRe: Help me understand this unusual query... Pin
Member 450194029-Dec-09 5:47
Member 450194029-Dec-09 5:47 
QuestionNeed help with constructing one query statement [modified] Pin
James Shao27-Dec-09 3:43
James Shao27-Dec-09 3:43 
Hi, I am trying to construct a query statement that allows me to retrieve what’s known as “Bullish Divergence” in stock investing signals. It occurs when stock price reaches to a new high level, surpassing a previous price peak, while a certain strength indicator on the same date fails to surpass the strength indicator of the previous peak. This would suggest the stock price is over-valued.

The logic is to first find all the stocks whose prices have reached new highs on 11/24/2009 within the past 10 days, and if their RSI figures fail to be greater than the RSI figures of the previous peaks, then we have a bullish divergence. Smile | :)

I currently have the following query statement, which returns an error message saying “Subquery returned more than 1 value and cannot be used when subquery follows <, >, >=, <=, =”. Could anyone please help me with this? Dead | X| I would be very thankful as I’ve spent hours trying to get it to work. Thanks!!
SQL
SELECT Date, Ticker, Price, RSI
FROM Table
WHERE (Price =
(SELECT MAX(Price) AS Expr1
FROM Table AS t2
WHERE (Table.Ticker = Ticker) AND (Date BETWEEN DATEADD(day, - 10, '11/24/2009')
  AND '11/24/2009'))) AND (Date = '11/24/2009') AND 
(RSI <
(SELECT RSI
FROM Table AS t3
WHERE (Price =
(SELECT MAX(Price) AS Expr1
FROM Table AS t4
WHERE (t3.Ticker = Ticker) AND (Date BETWEEN DATEADD(day, 
-10, '11/23/2009') AND '11/23/2009')))))


modified on Tuesday, December 29, 2009 8:38 PM

AnswerRe: Need help with constructing one query statement Pin
Blue_Boy27-Dec-09 10:21
Blue_Boy27-Dec-09 10:21 
GeneralRe: Need help with constructing one query statement Pin
James Shao27-Dec-09 18:38
James Shao27-Dec-09 18:38 
AnswerCan anyone please help? Pin
James Shao28-Dec-09 12:13
James Shao28-Dec-09 12:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.