Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Date related query

Author  Topic 

praveeri
Starting Member

5 Posts

Posted - 2010-06-25 : 08:38:38
HI

I have two tables. One table updates every day. Another table doesn't. I have to match the second table based on the date of first table until the date in first table and second table matches and so on.


any body can healp

senthil_nagore
Master Smack Fu Yak Hacker

1007 Posts

Posted - 2010-06-25 : 08:43:33
post the tables structure with sample data

Senthil.C
------------------------------------------------------
[Microsoft][ODBC SQL Server Driver]Operation canceled

http://senthilnagore.blogspot.com/
Go to Top of Page

praveeri
Starting Member

5 Posts

Posted - 2010-06-26 : 04:00:54
Table 1

Date Product qty rate WithEffet

Table 2

Date Product Qty rate

Say table 1 is a Price list table
Table 2 is Sales or Purchase Details based on the price list table

Price List table may be updated whenever required.
Sales or Purchase details table updated on every day and every transaction
I just want to match the price field between sales tabel and pricelist table.
The issue is dates in both the table may or may not match.

I need assistance to match the dates based on the highest minimum date or equal date on the Price list table
Go to Top of Page

sqlfresher2k7
Aged Yak Warrior

623 Posts

Posted - 2010-06-28 : 13:13:57
Can you post the sample data.
Go to Top of Page
   

- Advertisement -