Click here to Skip to main content
15,890,399 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Dear ALL,
I have Three Tables.

1) CALENDAR Table :
It Contains date (like 01012015 To Current Date).

2) Price Table:
It Contains ITEMCODE,DOCDATE,CALCPRICE.

3) CALEPrice Table(Output Table):
It Contains ITEMCODE,DOCDATE,CALCPRICE.

Eg:
Price Table
01 01052015 10
01 01062015 20
02 01072015 10
02 01082015 20

Output :

01 01012015 10
01 02012015 10
Upto
01 01052015 10
01 02052015 20
01 03052015 20
Upto
01 01062015 20
01 02062015 0
UpTo
01 25102015 0
02 01012015 10
02 02012015 10
Upto
02 01072015 10
02 02072015 20
02 03072015 20
Upto
02 01082015 20
02 02082015 0
UpTo
02 25102015 0


How to do this using Cursor Script SQL .
Posted
Comments
Kornfeld Eliyahu Peter 25-Oct-15 6:14am    
What query? I can't see no query here...
CHill60 25-Oct-15 10:35am    
Not clear - what columns are you expecting in your output, what is it meant to represent?
And what have you tried so far?
ZurdoDev 25-Oct-15 21:08pm    
Don't use a cursor.

1 solution

Refer this link
[Cursors Vs. Sets].

You will get the idea on what to do.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900