To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here

HOME News MS SQL Oracle DB2 Access MySQL PHP Scripts Books Links DBA Talk


Go Back   Database Journal Forums > Related Sites > SQL Course

SQL Course SQL Course > Ask questions about the lessons on SQL Course 1 and 2. If you have problems > with the interface, please post in the Feedback forum

Reply Post New Thread
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old 01-29-2003, 04:46 PM
OLBRA OLBRA is offline
Junior Member
 
Join Date: Jan 2003
Posts: 3
Post Easy select ????

I' have problems doing a query into our product register.

I have two tables

VVARPF contains ProductInformation
VVVARE = ProductNumber
VVTEK = ProductDescription

VVPRPF contains PriceChanges
VPVARE = ProductNumber
VPDATE = ChangedDate
VPPRICE = ProductPrice

I need to lookup the price on the product at the current time. The VVPRPF register can contain prospective pricechanges used for future campaigns etc. That means I can't select the largest date.
Reply With Quote
  #2  
Old 01-29-2003, 07:27 PM
skhanal skhanal is offline
Experts
 
Join Date: Nov 2002
Location: New Jersey, USA
Posts: 3,369
It assumes the price which last changed before current date is the right price.


select product.VVVARE, price.VPPRICE
from VVARPF product, VVPRPF price
where product.ProductNumber = price.ProductNumber
and price.VPDATE =
(select max(VPDATE)
from VVPRPF
where VPDATE < getdate()
and VVPRPF.VVVARE = product.VVVARE)
__________________
http://gotodba.com
Reply With Quote
  #3  
Old 01-30-2003, 03:13 AM
OLBRA OLBRA is offline
Junior Member
 
Join Date: Jan 2003
Posts: 3
Cool Thanks, it works !!!!!!

Thanks, it works !!!!!!
Reply With Quote
Reply Post New Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 11:23 AM.


DatabaseJournal Recent Articles


 » Searching and Sorting Strings in Oracle

 » Preparing To Upgrade Access Tables to SQL ...

 » Sun Expands MySQL With Closed Source

 » Microsoft Demos New SQL Server Features at...

 » Wipro and Oracle Launch First Joint Innova...

Search Database Journal:
 





Acceptable Use Policy

JupiterOnlineMedia

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Web Hosting | Newsletters | Tech Jobs | Shopping | E-mail Offers

Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.