Click here to Skip to main content
15,890,845 members
Home / Discussions / Database
   

Database

 
GeneralRe: SQL table organization for authentication Pin
Paul Conrad28-Dec-05 6:51
professionalPaul Conrad28-Dec-05 6:51 
Questionhow to declare the procedures Pin
sasire1828-Dec-05 0:53
sasire1828-Dec-05 0:53 
AnswerRe: how to declare the procedures Pin
S. Akif Kamal28-Dec-05 1:24
S. Akif Kamal28-Dec-05 1:24 
Questionstoring xml doc in asp page uisng sqlserver Pin
suneelbabu_net27-Dec-05 19:02
suneelbabu_net27-Dec-05 19:02 
Questionstoring xml file in sqlserver Pin
suneelbabu_net27-Dec-05 15:59
suneelbabu_net27-Dec-05 15:59 
AnswerRe: storing xml file in sqlserver Pin
rihdus27-Dec-05 18:19
rihdus27-Dec-05 18:19 
GeneralRe: storing xml file in sqlserver Pin
suneelbabu_net27-Dec-05 18:42
suneelbabu_net27-Dec-05 18:42 
QuestionMS-SQL server Self join Pin
Amit Malik25-Dec-05 19:11
Amit Malik25-Dec-05 19:11 
Hello,
This is urgent.
I have a Table ARTICLE_MASTER.
fields are item_code, activation_date.

I can different item_code for each article.
each article has a activation date.

select * from ARTICLE_MASTER
inner join
ARTICLE_MASTER ARTICLE_MASTER1
on ARTICLE_MASTER.item_code= ARTICLE_MASTER1.item_code
where ARTICLE_MASTER.activation_date < = getdate() and
ARTICLE_MASTER.end_date > = getdate() and
ARTICLE_MASTER.activation_date > ARTICLE_MASTER1.activation_date
order by article_master.item_code

I can have 4 rows for a single article - say 001- for Comb.
and for a given month say December, my acticle master can have 4 rows for article 001. with activation date and end date, for a single article i can have 4 rows.
say
ITEM_CODE               ACTIVATION_DATE            END_DATE        PRICE
001                     01/12/2005                 31/12/2005      15
001                     07/12/2005                 31/12/2005      20
001                     14/12/2005                 31/12/2005      25
001                     21/12/2005                 31/12/2005      20


SO After comparison with my current date i have to decide which price to apply.
say on 2nd dec price should be 15
on 8th dec price should be 20
on 15th dec price should be 25
on 21-22th dec price should be 20
so i need to pick the appropriate row for a given date.
The query i have written above gives only the latest one say on 16th still it gives me 21st dec's row.

Please give me a solution for it.
its urgent



Amit Malik

.NET Developer
AnswerRe: MS-SQL server Self join Pin
Michael Potter27-Dec-05 3:22
Michael Potter27-Dec-05 3:22 
Questiondelete trigger Pin
Vipin.d25-Dec-05 17:16
Vipin.d25-Dec-05 17:16 
AnswerRe: delete trigger Pin
Colin Angus Mackay26-Dec-05 2:40
Colin Angus Mackay26-Dec-05 2:40 
Questionneed help about database Pin
ngAnhTuan24-Dec-05 20:54
ngAnhTuan24-Dec-05 20:54 
AnswerRe: need help about database Pin
Colin Angus Mackay26-Dec-05 2:37
Colin Angus Mackay26-Dec-05 2:37 
GeneralRe: need help about database Pin
Paul Conrad28-Dec-05 5:34
professionalPaul Conrad28-Dec-05 5:34 
QuestionPL/SQL Pin
sarojsneha24-Dec-05 19:40
sarojsneha24-Dec-05 19:40 
AnswerRe: PL/SQL Pin
rihdus26-Dec-05 1:29
rihdus26-Dec-05 1:29 
AnswerRe: PL/SQL Pin
rihdus26-Dec-05 3:56
rihdus26-Dec-05 3:56 
QuestionSQL DATENAME() QUESTION... Pin
lior654#hotmail.com24-Dec-05 18:58
lior654#hotmail.com24-Dec-05 18:58 
AnswerRe: SQL DATENAME() QUESTION... Pin
Colin Angus Mackay26-Dec-05 2:36
Colin Angus Mackay26-Dec-05 2:36 
QuestionSQL Query Pin
karthik_dotnet123-Dec-05 20:09
karthik_dotnet123-Dec-05 20:09 
AnswerRe: SQL Query Pin
Gunvant Patel26-Dec-05 22:58
Gunvant Patel26-Dec-05 22:58 
GeneralRe: SQL Query Pin
Colin Angus Mackay27-Dec-05 0:38
Colin Angus Mackay27-Dec-05 0:38 
AnswerRe: SQL Query Pin
rihdus27-Dec-05 19:44
rihdus27-Dec-05 19:44 
QuestionCreate .Net SQL At Runtime Pin
Steve4523-Dec-05 6:46
Steve4523-Dec-05 6:46 
AnswerRe: Create .Net SQL At Runtime Pin
Colin Angus Mackay23-Dec-05 7:14
Colin Angus Mackay23-Dec-05 7:14 

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.