Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

A real Challenge

Status
Not open for further replies.

wangyc77

Programmer
Jan 24, 2007
1
TW
I would like to make the following data in my database

SID fromDate ToDate Price
1 2006/01/01 2006/1/3 100
1 2006/1/4 2006/1/5 150

into

SID Adate Price
1 2006/1/2 100
1 2006/1/3 100
1 2006/1/4 150

When I specify a range
Please help~~!!
 
what happened to 2006/01/01 and 2006/1/5? why did they get dropped?

what are you trying to do?

r937.com | rudy.ca
 
You'll need calendar help table containing all dates.

Then you can do something like

SELECT sid, Adate, price
FROM calendartable, currenttable
WHERE Adate >= fromDate
AND Adata <= toDate
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top