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
 General SQL Server Forums
 New to SQL Server Programming
 SQL filter automatically uploading latest data

Author  Topic 

JorgenP
Starting Member

1 Post

Posted - 2012-01-30 : 08:21:25
Hi guys

I really need some help here.

I have joined 6 tables from access into one in another system. below is the setup for it.

SELECT Table_1.*, Table_2.*, Table_3.*, Table_4.*, Table_5.*, Table_6.*
FROM Table_1, Table_2, Table_3, Table_4, Table_5, Table_6
WHERE Table_1.RESPID = Table_2.RESPID
AND Table_2.RESPID = Table_3.RESPID
AND Table_3.RESPID = Table_4.RESPID
AND Table_4.RESPID = Table_5.RESPID
AND Table_5.RESPID = Table_6.RESPID
ORDER BY Table_6.YEAR

This works

My next step is now to narrowing the data down. Within all these tables, I have data for 2010 and 2011, and will within every month add more data to my setup. My problem is, that I need to find a way, where I can filter the data, so it automatically only gives me the latest four weeks data.

By doing it this way, I will always only have the latest data available. Does this make any seens?

Hope some of you can help me move forward.

Cheers

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-01-30 : 10:53:02
are you looking at access query or sql server query?
if latter, you can use ROW_NUMBER()function for that. If you can post data sample, i can show you

if its access,please post this in access forum

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -