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.
| Author |
Topic |
|
sunsanvin
Master Smack Fu Yak Hacker
1274 Posts |
Posted - 2008-02-29 : 07:22:57
|
| Dear All,i've a database with around 1300 tables.daily several transactions happens on several tables. what exactly i need is,from today 9Am to the next day 8:59AM transactions. each table is having datetime column. please help me in this regardVinodEven you learn 1%, Learn it with 100% confidence. |
|
|
Lumbago
Norsk Yak Master
3271 Posts |
Posted - 2008-02-29 : 08:24:01
|
| Hmm...something like this maybe? ->SELECT 'SELECT * FROM ' + table_name + ' WHERE DateColumn BETWEEN ''2008-02-28 09:00:00'' AND 2008-02-29 08:59:59'''FROM information_schema.tables WHERE table_type = 'base table'Maybe not exactly what you need but might get you on the right track?--Lumbago"SELECT Rum, Coke, Lime, Ice FROM bar WHERE ClosingTime = 'Late' AND FemaleMaleRatio > 4" |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-02-29 : 08:28:35
|
| select columns from tablewheredatecol>=dateadd(hour,9,dateadd(day,datediff(day,0,getdate()),0)) anddatecol<dateadd(hour,9,dateadd(day,datediff(day,0,getdate())+1,0))MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|
|
|